Reputation: 203
I just want to know is it possible to run and handle multiple processes in Django when i am using gunicorn server.
If one client is requesting for data and at the same time other client request the same then both process should be executed simultaneous instead of queue.
Is there any other way to make this happen.?
Upvotes: 4
Views: 2870
Reputation: 203514
You can start multiple worker processes:
gunicorn -w 4 ...
That would create 4 processes which each can handle one request at a time.
You could also use a different worker type, like gevent
or meinheld
, to make gunicorn handle requests asynchronously:
gunicorn --worker-class=gevent ...
gunicorn --worker-class="egg:meinheld#gunicorn_worker" ...
For those last two, you need to either install gevent (one of the rc versions) or meinheld.
Upvotes: 2