简体   繁体   中英

Django Rest Framework application with gunicorn deployment

I have a django rest framework application that is using class style views.

My deployment is simple: gunicorn --workers=4 application_name.wsgi -b 0.0.0.0:8000

The issue is that it takes only 4 requests at a time. If I send 20 requests concurrently, it processes them in groups of 4 at a time.

What do I have to do so that it processes all 20 requests concurrently?

According to the gunicorn docs , you need to set threads parameter in order to process requests concurrently, for example,

gunicorn --workers=4 --threads=10 application_name.wsgi -b 0.0.0.0:8000

will bring up 4 workers and each worker has 10 threads to process the requests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM