Speeding up CGIHTTPServer (Tim Roberts)
smnordby at yahoo.com
Tue Mar 8 14:55:50 CET 2005
"Diez B. Roggisch" wrote:
> > If there is no way to improve performance, could anyone tell my _why_ it's
> > running so slowly? Presumably spawning a process takes some time. The
> > code I'm running as CGI is not hectic at all.
> Just an educated guess: Maybe some timeouts or slowly answered requests are
> the problem - e.g. DNS is often a candidate than can slow down network
> experience a lot. So maybe thats causing your trouble?
I also got very slow responses using Python's HTTP server library. I found that
changing the address_string(self) method in
BaseHTTPServer.BaseHTTPRequestHandler to return self.client_address instead
of doing a hostname lookup cured the problem. The doc string says the method is
only used for logging, and so far I've experienced no ill side effects.
More information about the Python-list