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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: more FTP in single time
by ig (Vicar) on Jun 29, 2009 at 07:00 UTC

    If you want to run multiple FTP sessions concurrently you will need to create multiple concurrent processes or threads. Each process or thread can upload one file. You can create as many concurrent processes or threads as necessary to optimize throughput.

    You might want to limit the number of concurrent connections, to avoid overloading the server, network or client system. There are various modules which would help with this. You might consider LWP::Parallel::UserAgent, Parallel::ForkManager or one of the other Parallel modules, Proc::Queue, POE or others.

    You should try to determine what is limiting your throughput. Creating multiple concurrent FTP sessions may not help if they all share a single limiting resource (e.g. a single network link that is at capacity). Simple manual tests can confirm that multiple concurrent sessions will improve throughput. It might be worth doing this before developing a more complex program.

Re: more FTP in single time
by Corion (Patriarch) on Jun 29, 2009 at 06:38 UTC

    Why do you think that three FTP transfers will be faster than one?

Re: more FTP in single time
by ELISHEVA (Prior) on Jun 29, 2009 at 08:04 UTC

    If fast upload is really important on an ongoing basis, you might want to consider checking (and renegotiating) the terms of your ISP account. Many providers (in Israel) provide upload speeds about 1/10 of download speeds on the supposition that most customers are browsing (downloading) rather than uploading. Usually the download speed is widely advertised. The upload speed is not. This can make for excruciatingly slow uploads, no matter how many connections you have.

    Best, beth

      In my experience, the same is true of most DSL lines in the USA. (There is such a thing as SDSL, where upload and download speeds are equal, but it's extremely rare, especially in the residential market.) Cable modems tend to be even more heavily unbalanced, with 1:20 or even 1:100 ratios of up:down bandwidth.
Re: more FTP in single time
by unixmonster (Initiate) on Jun 29, 2009 at 13:58 UTC
    I am also agreeing with multithreading concept in multiple upload scenario. May be you can use thread; for the same. I will also suggest to first check your upload speed. But one thing is sure that your Datatransfer will take less time in Multiple threads rather then transfering it one by one.