On 20 December 2010 13:54, Matt Hamilton <ma...@netsight.co.uk> wrote:
> 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. > Just some possibles: - How many DNS lookups is each doing? Have you timed it by IP address, or with example.com in the hosts file? - I understand ab isn't reusing the HTTP connection - could it be reusing the TCP connection or avoiding the 3-way handshake? (My understanding of repeated HTTP requests is sketchy) - Are ab and urllib transferring the same number of bytes? Is one or the other (not) using compression? - Is ab somehow causing fewer, larger packets to be used in either the request or the response? I'd probably be reaching for a packet capture about now. -- Alex Willmer <a...@moreati.org.uk> http://moreati.org.uk/blog http://twitter.com/moreati
_______________________________________________ python-uk mailing list python-uk@python.org http://mail.python.org/mailman/listinfo/python-uk