best apache+python module?
Sam Penrose
see at message.body
Fri Jul 28 01:24:53 EDT 2000
In article <20000728113918.B12152 at inkontact.com.au>, Steve Purcell
<stephen_purcell at yahoo.com> wrote:
> Jason Ives wrote:
> >
> > I've been looking for an apache module that will run python .cgi's
> > without
> > having to instantiate a new interpreter for each request. [snip] They
> > all
> > seem rather sparsely supported..
>
> Check out PCGI:
> http://www.digicool.com/releases/pcgi
>
> There's a HOWTO here:
> http://starship.python.net/crew/jbauer/persistcgi/howto/index.html
>
> -Steve
After having a Bad Experience with one of these (memory leak in
PyApache), I must ask why they are so popular. My company writes
pure-Python sites whose CGIs handle tens of thousands of hits a day on
unremarkable Intel hardware running vanilla Linux. Two of our CGIs have
started to bog down recently, and in both cases the cause is the same:
have to generate HTML pages roughly a meg in size; one containing so
many images that the number of Apache processes goes through the roof.
In neither case would faster Python performance help.
Linking your interpreter to Apache forces you into dependence on a chunk
of code that has orders of magnitude less testing than either Apache or
Python does, probably wouldn't remove any bottlenecks if they existed,
and may well break the next time either Python or Apache is updated.
Unless, of course, you know differently. But my sense is that most of
the people interested in these modules merely know they want their sites
to run fast and have read the mod_perl marketing materials.
Anyone who can afford 256 megs of RAM and a SCSI hard drive can serve
thousands of people a day with sites that execute thousands of lines of
Python, without working particularly hard to optimize their software
(CGIs or Python or the OS). And if they find they can't, they should not
assume that a persistent Python executable will help without having good
reason to do so.
--
spenrose at well dot com
More information about the Python-list
mailing list