Perl NET::FTP upload took around 50% or twice longer than via DOS prompt ftp
Hi,

I tried with the simple perl script to upload 3mb file to the FTP server in the cloud, and noticed it took almost twice longer than manual On the same PC WinXP, network, Server, ... everything, the different is using Perl script (NET::FTP) and DOS Prompt 'ftp ftp.server.com' follow username and password then put a 3mb file (upload).
I got Wireshark to capture in both scenarios one at a time, NET::FTP and Dos Prompt. Noticed that using NET::FTP client mostly upload 5-6 packets of 1314 bytes at a time then almost a 600-800 milliseconds later FTP server responds, then another 5-6 packets upload and another almost 600-800 milliseconds from Server and so on till end of file.
With Dos Prompt, I see, client upload 2 packets of 1314 bytes at a time and FTP server responds in less than 100-200 milliseconds then upload 2 packets again then FTP server responds withing 100 millisec again.
Maybe same FTP server would better and faster process or take 2 packets a time? Can we modify NET::FTP or ftp.pm to set upload less packets at a time?
Anyhelp would be very appreciated.
==============
use Net::FTP; $ftp = Net::FTP->new("some.host.name", Debug => 0) or die "Cannot conn +ect to some.host.name: $@"; $ftp->login("anonymous",'-anonymous@') or die "Cannot login ", $ftp->m +essage; $ftp->cwd("/pub") or die "Cannot change working directory ", $ftp->mes +sage; $ftp->put ("that.file") 13. or die "get failed ", $ftp->message; $ftp->quit;
----
I try to read the ftp.pm but no clue whether on how, if can be changed, and what value of buff or lenght to be changed
This is an issue of (Net::FTP) I guess people using Net::FTP mainly not concern about thruput.

In reply to Net::FTP Upload much slower than Dos prompt command ftp by timothy_k

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.