Skip to content Skip to sidebar Skip to footer

Why Does Multiprocessing Work On Django Runserver And Not On Ngnix Uwsgi?

I have a Django 1.6 using python3.3 application which receives an http request, does short term work, starts a new process and returns in a matter of 2 seconds. The process typical

Solution 1:

This is explained in the (probably) most important page of the uWSGI docs: http://uwsgi-docs.readthedocs.org/en/latest/ThingsToKnow.html

When you fork() the process, the new one will inherit the connection descriptor. You have to close it in the new forked process, or you can add the --close-on-exec option to force it automatically

Solution 2:

Alternatively, you can use djcelery for the asynchronous tasks. You also get the tasks queue, scheduled execution, monitoring, etc.

Post a Comment for "Why Does Multiprocessing Work On Django Runserver And Not On Ngnix Uwsgi?"