Python daemon instead of CGI programs

Doug Farrell writeson at earthlink.net
Wed Mar 6 17:44:03 EST 2002


Hi all,

I've got an idea that anyone is welcome to shoot holes in as it's only
in the 'thought' process now. <g> I work for a company that develops
big content web sites using CGI's built with C++ as the primary
programming model. We also use Netscapes iPlanet as our web server.
I'm of the opinion this is akin to killing a fly with a sledgehammer
and am thinkin of some other mechanism. One thought that occurred to
me was to create a Python daemon that has a thead pool, a pipe pool
and all the CGI functionality built into classes that could be run by
a thread. Here's what I'm thinking, create an SAF (Server Application
Function) directive that will direct all the URL and POST information
down the pipe to the waiting Python daemon. The daemon kicks off a
thread from the pool to run the appropriate 'CGI' handler class. This
class directs all it's output into the same pipe back to the server.
The server forwards all this data to the users browser. Doing this
allows us a couple of things. By having a daemon the Python
interpreter is already in memory and doesn't have to be loaded. All of
the 'CGI' code is also in memory all the time, this would make
execution of that code pretty fast. We get to develop in Python, which
has a faster development cycle than C++ code. We can handle multiple
requests to the server because of the multiple pipes/threads in the
Python daemon. We don't have to work out any of the complexities of
connecting mod_python.so to iPlanet.

What do you think of this idea? Am I completely off base and missing
some other obvious solution?

Thanks in advance,
Doug



More information about the Python-list mailing list