in reply to Re: Getting/handling big files w/ perl
in thread Getting/handling big files w/ perl

From your description, I doubt that the process could be tremendously improved as it stands: the process is I/O-bound and the I/O capabilities of the machine are lackluster. The process could be realistically (but, perhaps significantly) improved by re-defining it and then, as others suggested, “throwing silicon at” (the re-defined process).

Now to debunk Yet Another of your Inglorious Theories.

This shows a perl program downloading an 11MB file using 1,2,4,8,16 & 32 concurrent streams, on my 4 core CPU, across my relatively tardy 20Mb/s connection:

C:\test>1107326 -T=1 http://************/goldenPath/hg19/chromosomes/c +hr21.fa.gz Fetching 11549785 bytes in 1 x 11549786 streams Received 11549785 bytes Took 55.765514851 secs C:\test>1107326 -T=2 http://************/goldenPath/hg19/chromosomes/c +hr21.fa.gz Fetching 11549785 bytes in 2 x 5774893 streams Received 11549785 bytes Took 27.654243946 secs C:\test>1107326 -T=4 http://************/goldenPath/hg19/chromosomes/c +hr21.fa.gz Fetching 11549785 bytes in 4 x 2887447 streams Received 11549785 bytes Took 15.210910082 secs C:\test>1107326 -T=8 http://************/goldenPath/hg19/chromosomes/c +hr21.fa.gz Fetching 11549785 bytes in 8 x 1443724 streams Received 11549785 bytes Took 9.515606880 secs C:\test>1107326 -T=16 http://************/goldenPath/hg19/chromosomes/ +chr21.fa.gz Fetching 11549785 bytes in 16 x 721862 streams Received 11549785 bytes Took 8.902327061 secs C:\test>1107326 -T=32 http://************/goldenPath/hg19/chromosomes/ +chr21.fa.gz Fetching 11549785 bytes in 32 x 360931 streams Received 11549785 bytes Took 16.386690140 secs

As you can see, you get diminishing returns from the concurrency, but over provisioning the 4 core CPU to manage 16 concurrent IO-bounds threads results in the best throughput.

And how does that compare to using WGET and a single thread on the same connection and processor:

C:\test>wget http://************/goldenPath/hg19/chromosomes/chr21.fa +.gz --2014-11-17 11:38:37-- http://************/goldenPath/hg19/chromosom +es/chr21.fa.gz Resolving ************... 128.114.119.*** Connecting to ************|128.114.119.***|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 11549785 (11M) [application/x-gzip] Saving to: `chr21.fa.gz' 100%[================================================================= +===================>] 11,549,785 379K/s in 32s 2014-11-17 11:39:30 (352 KB/s) - `chr21.fa.gz' saved [11549785/1154978 +5]

It beats it hands down!

************ server name redacted to discourage the world+dog from hitting them by way of comparison.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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.