Speeding up CGIHTTPServer (Tim Roberts)
paul at boddie.org.uk
Tue Mar 8 20:04:52 CET 2005
"Johan Kohler" <kohlerj at ukzn.ac.za> wrote in message news:<mailman.77.1110283037.1799.python-list at python.org>...
> Fair enough. Pretend my question said "compared to apache, but also to
> CGIHTTPServer on linux". The Windows box has modest specs Celeron 2.8GHz,
> 256MB, but it takes 30-60s render pages. I was using it to test my cgi
> locally, ie. no network, one user
> Windows bashing is fun :-) but unfortunately I don't think that is the
> issue here. The answer I was looking for was something like - "yes,
> change config file so-and-so in such-and-such a way" or simply "no."
There was a mention of the supplied Web server for Windows 98, which I
suppose is similar to the one they used to ship with NT 4.0, but apart
from being fairly basic I don't think it would help performance.
> 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.
Windows isn't known for great process-spawning performance, but it
occurs to me that there could be a network issue somewhere -
CGIHTTPServer seems to attempt reverse DNS lookups and whilst it would
seem perverse that anything would spend lots of time on reverse
lookups for the address 127.0.0.1, I seem to recall strange things
with previous generations of Windows and definitions of localhost.
Anyway, if you want to write programs for eventual deployment in a
more reliable CGI environment whilst taking advantage of a
simpler/faster development environment, I am as inclined as ever to
push WebStack - a framework which provides portability between
different environments (from Twisted through to Zope), albeit with its
own more high-level API than that exposed by plain old CGI:
More information about the Python-list