http://www.perlmonks.org?node_id=984897

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

Hello PerlMonks,

I have an automated script using Net::FTP to upload large files and I saw from MRTG graphs that it's transferring at a rate of about 80Mbps. Since our commitment is only 50Mbps, and we don't want to get hit with overage charges, I tried to find a way to limit the upload speed to somewhere around 50Mbps.

I tried implementing Net::FTP::Throttle like this:

my $ftp = Net::FTP::Throttle->new($host, Debug => 0, Passive => 1, Bytes_read => 4096, BlockSize => 4096, MegabitsPerSecond => 50) or die "Cannot connect: $@";
But it is maxing out at about 6.5Mbps - no matter what values I try for Bytes_read, BlockSize, and MegabitsPerSecond, MRTG shows a max upload rate of about 6.5Mbps. This is too slow, does anyone know why this might be happening or another good way to limit FTP script to 50mbps?

Thank you very much in advance. With kind regards, joe