httplib VERY slow

R

reacocard

Hi, I'm writing a download manager in python, and httplib is being
very slow when pulling from localhost or even other servers on the
local network. I'm getting about 10MB in 14s with httplib, while wget
hits 80MB in less than 3s. You can find the code I made to benchmark
this here: http://pastebin.ca/973486 (noslor is mapped to my IP in /
etc/hosts)

Does anyone have any idea what might be causing this, and how I can
fix it? I'm using python2.5 under Ubuntu Linux 8.04 with apache2 for
the webserver.

Thanks in advance.
 
R

reacocard

Hi, I'm writing a download manager in python, and httplib is being
very slow when pulling from localhost or even other servers on the
local network. I'm getting about 10MB in 14s with httplib, while wget
hits 80MB in less than 3s. You can find the code I made to benchmark
this here:http://pastebin.ca/973486(noslor is mapped to my IP in /
etc/hosts)

Does anyone have any idea what might be causing this, and how I can
fix it? I'm using python2.5 under Ubuntu Linux 8.04 with apache2 for
the webserver.

Thanks in advance.

Upon further investigation, the slowness appears to be related to this
bug report: http://bugs.python.org/issue508157
Applying the fix given in the bug report speeds up httplib immensely.
So now the question becomes, what is the best way to implement this?
Should I go ahead and subclass most of httplib, or is there an easier
way?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top