[Zope] Re: ZopeHTTP speed problem.
Stefan Franke
sfranke@cdc-group.com
Wed, 14 Apr 1999 09:58:24 +0200
[This is a crossposting from c.l.p to the zope@zope.org mailing list,
since it contains a problem report and a proposal/question
concerning both]
On Mon, 12 Apr 1999 22:57:32 GMT, befletch@my-dejanews.com wrote:
[...]
> I found I have to use
>my machine's numeric IP address, not 'localhost' as the docs indicate.
Do you get the long response times even *with* using your
localhost's IP address?
I once had a similar problem with response times even up to
a minute for each HTTP request, and I found out that it was
due to the logging mechanism in the standard library's
BaseHTTPServer.py:
BaseHTTPRequestHandler.log_message calls the
address_string function, which does a reverse name lookup
of the request's IP address. If neither yout DNS nor the
etc/hosts table (it lives in \WINNT\system32\drivers\etc\hosts
on a NT machine, don't know about 95/98) are configured
correctly, timeouts occur on each request.
There are two calls to address_string in Zope, one in
BaseHTTPRequestHandler.log_message and one in
ZopeHTTPServer.BoboRequestHandler.get_environment
Both can be changed to self.client_address[0], so that
only IP addresses are used for logging and the
REMOTE_HOST environment variable is never set.
What I would appreciate is to make this behaviour
configurable, but it would require changes to both
BaseHTTPRequestHandler and BoboRequestHandler.
Any ideas?
Stefan