1

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:

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

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.

3
  • Please post TEXT results from OS of A) ulimit -a so we can see your OS limits and from root login to mysql, B) SHOW GLOBAL STATUS LIKE '%open%' ; and C) SHOW GLOBAL VARIABLES LIKE '%open%'; and D) SHOW GLOBAL STATUS LIKE '%dirty%'; and E) SHOW GLOBAL STATUS LIKE 'uptime'; for analysis. Dec 29, 2020 at 21:33
  • Data posted looks OK. Additional information request. Any SSD or NVME devices on MySQL Host server? Post on pastebin.com and share the links. Django and Apache config files. From your SSH login root, Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; G) SHOW ENGINE INNODB STATUS; AND Optional very helpful information, if available includes - htop OR top for most active apps, iostat -xm 5 3 for IOPS by device and core/cpu count, for server workload tuning analysis to provide suggestions. Jan 5, 2021 at 15:30
  • Any chance you will be able to post additional information requested on Jan 5 at 15:30? View profile, Network profile for contact info and free downloadable Utility Scripts to assist with performance tuning. Jan 21, 2021 at 12:15

1 Answer 1

1

Thanks, here the commands output

A) Runned into the root ubuntu running Docker: ulimit -a

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 62405
max locked memory       (kbytes, -l) 65536
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 62405
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

B) Runned into the mysql container: SHOW GLOBAL STATUS LIKE '%open%';

+----------------------------+-------+
| Variable_name              | Value |
+----------------------------+-------+
| Com_ha_open                | 0     |
| Com_show_open_tables       | 0     |
| Innodb_num_open_files      | 29    |
| Open_files                 | 14    |
| Open_streams               | 0     |
| Open_table_definitions     | 113   |
| Open_tables                | 114   |
| Opened_files               | 149   |
| Opened_table_definitions   | 113   |
| Opened_tables              | 121   |
| Slave_open_temp_tables     | 0     |
| Table_open_cache_hits      | 25    |
| Table_open_cache_misses    | 121   |
| Table_open_cache_overflows | 0     |
+----------------------------+-------+

C) SHOW GLOBAL VARIABLES LIKE '%open%';

+----------------------------+---------+
| Variable_name              | Value   |
+----------------------------+---------+
| have_openssl               | YES     |
| innodb_open_files          | 2000    |
| open_files_limit           | 1048576 |
| table_open_cache           | 2000    |
| table_open_cache_instances | 16      |
+----------------------------+---------+

D) SHOW GLOBAL STATUS LIKE '%dirty%';

+--------------------------------+-------+
| Variable_name                  | Value |
+--------------------------------+-------+
| Innodb_buffer_pool_pages_dirty | 0     |
| Innodb_buffer_pool_bytes_dirty | 0     |
+--------------------------------+-------+

E) SHOW GLOBAL STATUS LIKE 'uptime';

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Uptime        | 544   |
+---------------+-------+
1
  • It is more helpful to post data after 24 hours of Uptime. Additional suggestions could be provided if you could post information requested on Jan 5 at 15:30. Have a GREAT 2021. Jan 21, 2021 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .