-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Daphne performance stuck to 10rq/s #350
Comments
Hi @senechalloic wondering if this is django/channels#1587. See also django/channels#1582. I'd be inclined to serve Django views using a WSGI server, using Daphne/ASGI just for the Channels specific stuff for now. |
Thanks a lot for your response that helps me a lot. This looks really a lot like other issues you mentioned, I will follow these issues. I have no idea if we should close this issue or not, but I now have a workaround for my issue. |
@senechalloic -- I'll leave it open for now. It's on my list to address for the new year, but Django 3.2a1 out the way first. 😄 |
New testsHello, I have tested:
I have had the exact same issue, which is :
So I'm not sure the problem is coming from daphne in my case. Next stepsI will try:
|
Final solutionFor anyone having the same issue. I found out using Uvicorn:
Instead of daphne:
This helped me to have much better performance. About five time better. |
@senechalloic That's not really a solution but a workaround. Each individual worker will still be blocking while serving each client request, but you now just have 8 workers that will be rotated through. |
Yes it's a workaround. And this didn't really help, as you mentionned. What saved my live, in this project, is two things: As a result the performances were much much much better allowing more than 100rq/s |
This was resolved by the per-request async context added in Django 4.0 — It's not really a Daphne issue. |
I am still getting the same issue (using 4.1.13 django version) |
Setup
I have configured Django Channels inside a docker container on server Ubuntu 20.04 OVH VPS (8vCore, 16Go RAM). To run django-channels I used daphne. Versions:
I used Docker-compose with an image for Daphne-Apache, an image for Mysql, an image for Redis.
Issue
I used Locust to check the load performance of the application. When I have more than 10rq/s, the server HTTP response time becomes huge (> 10 sec) and the application becomes unavailable.
Where is the bottleneck? What could improve the performance?
Extra Info
ConnectionError(ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))
I've searched and found out using multiples process with supervisord or Kubernetes could help. But I want to be sure everything is normal before evolving to that.
I can share project files docker-compose.yml, routing.py, settings.py but it doesn't seems helpful to me for now.
The text was updated successfully, but these errors were encountered: