Recommendation for small, fast, Python based web server

Tim Chase python.list at tim.thechases.com
Wed Dec 9 16:27:18 EST 2009


python at bdurham.com wrote:
> I'm looking for a small, simple, fast, Python based web server
> for a simple, client side application we're building. 

I've used WebStack[1] for this in the past.  It allows for 
stand-alone serving as well as plugging nicely into various 
"real" servers (apache+mod_python, etc) with a small tweak in how 
it's configured.

> I've looked at the web servers that come bundled with the Python
> standard library[1] and they are too slow. I suspect this is
> because they don't maintain a session between the client and
> server, thus every GET/POST request repeats the session setup and
> break down process. Or they might be based on a polling model?

I'm not sure what caused the slowness you've experienced -- using 
Python in a CGI environment requires starting the Python 
interpreter each time.  However if the interpreter starts just 
once, I've not had notable performance issues for low-volume 
sites (using the BaseHTTP builtin).  For higher-volume sites, you 
might reach for Twisted which WebStack supports as well.  I 
believe both WebStack and Twisted are redistribtable as needed.

-tkc

[1] http://www.boddie.org.uk/python/WebStack.html







More information about the Python-list mailing list