[Ssh-sftp-perl-users] SFTP transfer rate limited?
Brought to you by:
dbrobins
|
From: Ong, Q. (N-Titan) <qua...@lm...> - 2007-06-01 00:06:36
|
For those who have been able to successfully use the Net::SFTP module,
what kind of transfer rates are you getting? We have it successfully
installed (with GMP libs) and it seems to work, but the transfer rate
seems artificially limited.
Using Net::SFTP, we get like 900+kb/sec transfer rates (on an ethernet
LAN). Using the command line sftp, we get almost 8MB/sec transfers
(20MB/sec transfers via FTP). However, using the Net::SFTP module, the
most we ever get is 150-170kb/sec. I don't think it's CPU bound because
it never uses more than 45% of the CPU. I borrowed this code (thanks
David F) from another poster as a simple test script (but used a much
bigger file, 15MB):
#!/usr/bin/perl
use strict; use warnings;
use Net::SFTP;
#Create with: dd if=/dev/urandom of=/tmp/1mb.junk bs=1024 count=1024
# I used a 15MB file instead of 1MB to get more reliable stats
my $testfile = "/tmp/1mb.junk";
my %comm = (
user => 'USER',
password => 'PASSWORD',
ssh_args => [ cipher => '3des-cbc' ],
debug => 1,
);
# Connec to local host to remove any network latency issues
my $sftp = Net::SFTP->new('localhost', %comm) or die "oops: $@";
$sftp->put ($testfile, "$testfile.test")
or die("ftp put failed ", $sftp->message);
END{
print map{"$_\n"} sort keys %INC; #check for GMP/Pari
}
__END__
Thanks,
Quang
|