Daphne performance stuck to 10rq/s
See original GitHub issueSetup
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:
Django==3.1.4
channels==3.0.2
daphne==3.0.1
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
- Note 1: I have reduced the SQL Querries to very low amount, about 5 per page.
- Note 2: On the VPS info page, CPU, Mem, bandwidth is not fully used at all.
- Note 3: I serve static files with Apache Alias, but when the application is overloaded, even static files takes time to load.
- Note 4: The error I get when there is too much load
ConnectionError(ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))
- Note 5: I have followed all guidelines/configuration proposed in the read-the-doc.
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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
@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. 😄
@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.