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.
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.
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?
- 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')))
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.