Thanks for answer! python manage.py runworker --threads=4
This process consume CPU resources (daphne and delay processes seems not meaningful here). I'll try describe step by step: 1. daphne, workers and delay started and workers consume about 10% CPU 2. open new tab in chrome and worker's process CPU usage raises up for about 3-4% and start use about 13-14% 3. keep tab opened and do nothing, CPU usage still same even without any action (only keep WS connection alive). 4. close tab in chrome, WS disconnects but workers continue use same CPU 13-14% When i repeat open and close tabs CPU usage raising but not lowered when i close connection. So after some amount of iterations CPU usage raises up to 96% and system start to be unresponsive. I thought workers should free used resources when channel is closed. Also it's may be my fault somewhere (and i pretty sure it is). But i not sure where to start my investigation. On Monday, May 8, 2017 at 11:10:28 PM UTC+6, Andrew Godwin wrote: > > Daphne does tend to idle hot, but this is so it performs better under high > load. It's not clear from your description which of the processes is using > more CPU as connections come through and then disconnect - is it Daphne or > is it runworker? > > Andrew > > On Mon, May 8, 2017 at 5:46 AM, qnub <[email protected] <javascript:>> > wrote: > >> We have executed cluster of 3 docker containers (on separated machines) >> with daphne and workers --threads=4 in each container. And this container >> consube about 15% machine's CPU after start. Then it start consume >> addtional 4-5% of CPU per new connection and seems like not free this >> resources when user is disconnected (we've removing channels from groups on >> WS disconnection)… >> >> I've decreased amount of worker threads to 1 and now container get 3-5% >> of CPU after start and 1-2% per new user. Looks like now it started to free >> CPU after user disconnection when get about 10% of CPU. >> >> Also we use asgi_redis.RedisLocalChannelLayer with 3 redis instnaces >> (one per machine). >> >> I not sure if it's correct behaviour ot it's my fault somwhere? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/964cb488-a5d9-4f6c-890f-3c4dec4d2ec4%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/964cb488-a5d9-4f6c-890f-3c4dec4d2ec4%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9f89442c-3095-4be9-9a21-86192c7633d4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

