best way to serve wsgi with multiple processes

Robin robince at gmail.com
Wed Feb 11 14:28:01 CET 2009


On Feb 11, 12:10 pm, Robin Becker <ro... at reportlab.com> wrote:
> We've used forked fastcgi (flup) with success as that decouples the wsgi process
> (in our case django) from the main server (in our case apache). Our reasons for
> doing that were to allow the backend to use modern pythons without having to
> upgrade the server (which is required if using say mod_python). The wsgi process
> runs as an ordinary user which eases some tasks.

Yes - I've done something very similar with ajp-wsgi (from the author
of flup; and which incidently performs very well works really nicely)
to go from apache -> wsgi. But the issue I'm asking about here is to
have multiple WSGI processes - ie to allow concurrent execution of
more than one web service at the time (since these are long running
computational soap web services). ajp-wsgi embeds a single python
interpreter so multiple running services would be effected by the GIL
- I imagine flup is similar (a single process on the python side).

So I'm not worried about decoupling from the web server - I'm happy to
use pure python server (which I guess is easier to setup) - but I want
the web server to dispatch requests to different processes running the
wsgi app. I've looked at Spawning, but couldn't get it to work and it
seems a little bit 'beta' for my taste (doesn't exit cleanly, leaves
worker processes running etc.)

Cheers

Robin






More information about the Python-list mailing list