[Web-SIG] wsgi + multiprocessing

Ed Summers ehs at pobox.com
Mon May 2 15:05:22 CEST 2011


I realize this is probably a pretty silly question, but I was
wondering if anyone can provide any insight.

I've been trying to use the multiprocessing [1] in a WSGI environment
and have observed what appears to be deadlock behavior under
mod_wsgi+django and
web.py. I created a minimal example web.py to demonstrate [2]. If you
have web.py available you should be able to run that script and then
point your browser at:

    http://localhost:8080/

and then watch your browser hang when you visit:

    http://locahost:8080/?multiprocessing=1

Going forward I'm most likely going to move this functionality to an
asynchronous queue (celery, etc) but I was wondering if
multiprocessing + WSGI was generally known to be something to avoid,
or if it was even forbidden somehow.

Any assistance you can provide would be welcome.

//Ed

[1] http://docs.python.org/library/multiprocessing.html
[2] https://gist.github.com/951570


More information about the Web-SIG mailing list