in reply to Using Net::FTP::Throttle
I suspect that the setting of the maximum burst rate to 10k (10240) here (in new()):
my $mbps = $arg{MegabitsPerSecond} || croak "No MegabitsPerSecond +passed"; my $bps = $mbps * 1024 * 1024 / 8; my $bucket = new Algorithm::TokenBucket $bps, 10240;
Combined with the minimum accounting period of 1/100th of a second here (in get()):
sleep 0.01 until $bucket->conform($len); $bucket->count($len);
Means that the maximum throughput possible is 10kbytes per 0.001 of a second = 1000KBytes or (roughly) 10Mbps.
Throw in the out-of-band overheads (writing to the local file), and that probably explains why it has a fixed upper limit regardless of your requested limit.
Two (3) possible solutions:
Try doubling it and see what through put it gives you. Adjust accordingly.
Try halving it. Adjust ...
Also, 4096 byte blocksize seems very small for transferring large files across a network? I try 64k and see what affect that has.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Net::FTP::Throttle
by joetesta (Novice) on Aug 02, 2012 at 17:57 UTC | |
by BrowserUk (Patriarch) on Aug 02, 2012 at 23:06 UTC |