Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

HTTP: Slow download

by slonopotam (Initiate)
on Oct 05, 2004 at 13:28 UTC ( [id://396571]=perlquestion: print w/replies, xml ) Need Help??

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

Dear Monks, I'm using ActivePerl on WinXP SP2 platform. The following simple code:
$req = HTTP::Request->new(GET,$url); $res = $ua->request($req);
used to download a file from the remote web server. The file is really text, but the server transmits it as application/zip (so browser users can download it instead of opening in their browsers). Everything goes OK except one thing : the download is very slow, about 1..2Kbits/second. Download of the same file from the same server via IE, Opera, or download manager runs much (~20..100 times) faster. CPU usage is less then 1 per cent. This doesn't depend upon the file's size. Thanks in advance for any suggestions.

Replies are listed 'Best First'.
Re: HTTP: Slow download
by aquarium (Curate) on Oct 05, 2004 at 14:02 UTC
    is it going via a different route on your network? are you using a proxy either in IE or in your script (indirectly, by having http_proxy or such environment variable set)? Apart from those networking type things I would run Ethereal or other such network sniffer and watch the conversations to see what's happening vs the same download via IE.
Re: HTTP: Slow download
by lithron (Chaplain) on Oct 05, 2004 at 14:39 UTC
    Try using LWP::Simple and the 'get' function. See if that makes any difference. Also, download a copy of the 'wget' program for Win32 and test it out with the same $url you're using. See if it is any quicker.

    Also, what version of ActivePerl are you using?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://396571]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-18 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found