Re^3: Net::FTP Upload much slower than Dos prompt command ftp
by timothy_k (Novice) on Jan 13, 2011 at 06:26 UTC
|
Thanks Marto, Monk, and Khen,
I will try your suggestion tomorrow.
The problem / slow thruput only when Uploading to FTP server, when download from server to local PC using Net::FTP no problem, the thruput of download same and closely same as DOS prompt command.
It's interesting that NET::FTP introduces thruput problem in upload.
| [reply] |
|
|
${*$ftp}{'net_ftp_blksize'} = abs($arg{'BlockSize'} || 10240);
You can easily test this hypothesis by supplying a parameter BlockSize => 4096 to the constructor.
I'd step through 1024, 2048, 4096 etc. and see what difference if any that makes to your throughput.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
|
|
Remember, also, that upload speed depends on the capabilites of your host or provider. For example, a common ADSL configuration would be 1.54 Megabits per second for downloads, whereas uploads would be 640 Kilobits per second. That might
explain the difference in thruput:).
| [reply] |
|
|
Hi Khen,
my $ftp = Net::FTP::Throttle->new(
HOST,
...
Bytes_read => 8192,
In above Net::FTP::Throttle, is there something like
Bytes_write => 1024 or 2048 ?
Since the issue is uploading only.
-- Uploading the thruput is twice slower when using NET::FTP vs. Dos Prompt command ftp ftp.server.com 'put'
-- Downloading: the thruput when using either NET::FTP or Dos Prompt command are closely same.
The ftp server is on the WAN (in the cloud)
Everything the same, configuration, settings, PC, and HW. The different is NET::FTP and Dos Prompt, and the time is about 10 minutes apart between these 2 scenarios, as 3mb file Upload with Dos Prompt it took about 2-3 minutes, and with NET::FTP it took 4-5.30 minutes each time. I did over 10 times.
<Thanks everyone for help>
| [reply] |
|
|
I've been testing it, and the results are all over the map---nothing consistent. Unfortunately, Bytes_write seems to be the same as Bytes_read, so that won't help. Just make sure that you use a BlockSize suitable for your system. I tried it at 1024, 2048, 4096, and 8192. They were all about the same, time-wise.
| [reply] |
|
|
Hi Everyone,
Thanks very much for yours input. I did try and found that
adding BlockSize => 2518 (just right fit to 2 packets)
and the Upload thruput of uploading 3mb now is around 82-94 sec, even better than Dos Prompt -
By the way, ActivePerl does not have NET::FTP::Throttle
Thanks!!!
| [reply] |
|
|
| [reply] |
|
|
BlockSize => 2518
now its fast thanks for your post
| [reply] |