[python-uk] urllib latency

Matt Hamilton matth at netsight.co.uk
Mon Dec 20 15:27:14 CET 2010

On 20 Dec 2010, at 13:54, Matt Hamilton wrote:

> Ok, here's a non job related post...
> Anyone know why urllib.urlopen() can be so much slower than using ab to do the same thing? I seem to be getting an extra 100ms latency on a simple HTTP GET request of a static, small image.

Some more info on this... I've been tracing the packets with wireshark to try and see what is going on, and it looks like with urllib the data is returned pretty quickly, but there is then a 100ms delay as it seems to be shutting down the socket afterwards. I'm trying to work out why, but both urllib and ab appear to go through the same tcp dance to shut down the connection (both client and server send FIN).


Matt Hamilton                                         matth at netsight.co.uk
Netsight Internet Solutions, Ltd.          Business Vision on the Internet
http://www.netsight.co.uk                               +44 (0)117 9090901
Web Design | Zope/Plone Development and Consulting | Co-location | Hosting

More information about the python-uk mailing list