rajeev has asked for the wisdom of the Perl Monks concerning the following question:

I have found 2 problems using this module. My perl code simply makes the calls to the Net::SFTP's get and put functions. I am experiencing these two problems:.
1. The sftp put using the perl is almost 10 times slower than the simple Linux implementation of SFTP.
2. In a large transfer about 130MB file it hangs after running for about an hour..
here is the debug message I get when it hangs....
CLIENT.net: sftp: Sent message SSH2_FXP_WRITE I:13152 O:107732992.
CLIENT.net: sftp: In write loop, got 8192 offset 107732992.
CLIENT.net: sftp: Sent message SSH2_FXP_WRITE I:13153 O:107741184.
.
CLIENT.net: Warning: ignore packet type 20 .
Please help..

Replies are listed 'Best First'.
Re: Net:sftp module is slow and hangs
by salva (Canon) on Aug 21, 2007 at 06:17 UTC
      can't do the foerign because of password authentication. Anyway as a work around I have installed it and playing with using perl's Expect. Having trouble with transport method of it. Thanks for your input.
        We will be able to help you if you post the Expect code you are using.

        BTW, another option is to use Net::SSH2.

Re: Net:sftp module is slow and hangs
by cengineer (Pilgrim) on Aug 21, 2007 at 13:39 UTC
      Late in response since I was off from work for a while. Thanks guys for your input. I have used the crashingdaily's advice and it seems to work.
      But as far as speed of this module go, even after installing the Math::BigInt::GMP there is no impact on the speed. For my setup it is taking 90 minutes for a 130 MB file compare to 10 minutes from commandline. When I see on my linux box I have both GMP modules installed
      /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/Math/GMP.pm
      /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/Math/BigInt/GMP.pm
      Do I need to uninstall the Math::GMP and then install Math::BigInt::GMP? I am wondering which GMP is used by Net::SFTP module. Thx.
Re: Net:sftp module is slow and hangs
by ForgotPasswordAgain (Vicar) on Aug 21, 2007 at 13:29 UTC