At Daylife, we're running a whole lotta Python code inside Apache using mod_python. This works great so long as each request can be processed quickly, and you don't need your Python processes to keep much of anything in RAM.
However, any real web app inevitably needs to break those rules, at which point you start to venture into a world of increasing pain. Thus arises a need for alternatives to our cozy, familiar, tried-and-true mod_python.
I've set up Lighttpd before, but this time I decided to try Nginx. (It's pronounced "engine x")
Here's a quick demo recipe for running two standalone Python FastCGI+WSGI servers that listen on Unix domain sockets, and configuring Nginx to load-balance between them. This config allows you to run more than one Python VM, but not need N VMs to handle N concurrent requests. It also allows you to restart VMs individually with no service downtime.
Recent Comments