[Catalog-sig] Effect of HTTP 1.1

"Martin v. Löwis" martin at v.loewis.de
Fri Jul 13 19:07:30 CEST 2007


I did some measurements, with the script below.
For 30 requests, a single HTTP 1.1 connection
needs 5.4s over my DSL connection; 30 individual
connections need 11.7s. So if setuptools expects
to request multiple pages from the index, it would
definitely be useful to keep the connection
(I don't know at all whether it currently does so
already).

Regards,
Martin

import httplib, time

t=time.time()
h = httplib.HTTPConnection("cheeseshop.python.org")
for i in range(30):
    h.putrequest("GET", "/pypi/Lamina/")
    h.endheaders()
    r = h.getresponse()
    r.begin()
    r.read()
h.close()
print time.time()-t

t=time.time()
for i in range(30):
    h = httplib.HTTPConnection("cheeseshop.python.org")
    h.putrequest("GET", "/pypi/Lamina/")
    h.endheaders()
    r = h.getresponse()
    r.begin()
    r.read()
    h.close()
print time.time()-t


More information about the Catalog-SIG mailing list