[Web-SIG] wsgi + multiprocessing

Ed Summers ehs at pobox.com
Mon May 2 15:30:24 CEST 2011


Actually this appears to only be a problem for Django and web.py when
they are running under mod_wsgi. I don't see the hanging behavior when
running under django runserver, or single threaded web.py ... so
perhaps this question is best asked over on the mod_wsgi discussion
list?

//Ed

On Mon, May 2, 2011 at 9:05 AM, Ed Summers <ehs at pobox.com> wrote:
> 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