Python App Server Advice

Gerhard Häring gh at ghaering.de
Fri May 30 21:01:25 EDT 2003


Graeme Matthew wrote:
> Hi all
> 
> I have written a multithreaded app server that accepts incoming XML
> requests. My aim is to create apool of database connections and load all
> xslt template files when the server is started. I am using pyApache so
> inerpreter startup costs are nil. The area that is concerning me is for
> every web request a socket connection will need to be made to the appserver,
> the cgi args formatted into xml then send to the model layer (appserver) and
> wait while it processes it and then recieve html page and then print back to
> the client. I am looking at it this way, there will be no cost in creating
> database connections and reading templates form disk so I figured that
> equals out the socket connection cost on each request ?
> 
> any advice would be most welcome or even ugly criticism as I would like to
> get the architecture right before writing lots of code ....

What you've done is a common approach.

You'll probably want to limit the number of theads (and thus listening
connections) of your appserver. If you want to get a little fancier, you
can create a thread pool.

-- Gerhard




More information about the Python-list mailing list