You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gunicorn provides a different set of configuration options to Uvicorn, so some options such as --limit-concurrency are not yet supported when running with Gunicorn.
Like many, I cam to Uvicorn so I can run Django ASGI apps utilizing channels, without limiting myself to Daphne, which does not support multiple worker processes. In production, I'm running Gunicorn with a Uvicorn worker class as advised:
The uvicorn workers simply accept as fast as they can, creating an internal queue of async tasks inside each worker process, waiting to be run on the event loop. This would be fine in a fully async web application, but Django is not that - Channels runs synchronous Django views in a threadpool behind an async interface. The result is that requests can end up effectively queued inside a worker behind long-running requests, even if another worker process is idle. This effect is worse the lower the value of ASGI_THREADS.
I was hoping to avoid the need to set up NGINX just for this. So my question is if it's in the roadmap to ever support a kind of ceiling on HTTP requests, but no web socket requests, so Gunicorn can better utilize its N other workers instead of being "fooled" by uvicorn workers who are always consuming the incoming requests even if they are "busy".
If there are no plans to support this, perhaps it's better to change the docs for now?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, in the docs, under Deployment - Gunicorn, it states (emphasis mine):
Like many, I cam to Uvicorn so I can run Django ASGI apps utilizing channels, without limiting myself to Daphne, which does not support multiple worker processes. In production, I'm running Gunicorn with a Uvicorn worker class as advised:
But I'm seeing the behavior described in this closed issue (emphasis mine):
I was hoping to avoid the need to set up NGINX just for this. So my question is if it's in the roadmap to ever support a kind of ceiling on HTTP requests, but no web socket requests, so Gunicorn can better utilize its N other workers instead of being "fooled" by uvicorn workers who are always consuming the incoming requests even if they are "busy".
If there are no plans to support this, perhaps it's better to change the docs for now?
Beta Was this translation helpful? Give feedback.
All reactions