Thanks very much for your reply.
New Check Info:
-- Which make me confused now the CPU of Daphne is normal, keep 8% ~20%. I update the new info and new check here. I think it will return to 100% because I have not found the reason and do nothing.
Environment:
- OS: Ubuntu 18.04.1 LTS x86_64 GNU/Linux
- Python: 3.6.5
- Django: 2.1.1
- Daphne: 2.3.0
- Channels: 2.2.0
- channels-redis: 2.4.0
Check Info:
- check the thread numbers with ps -o thcount 22549, which shows 45 ( > 40)
- check the websocket connected numbers with redis cli: ZCOUNT asgi::group:USER_MESSAGE -inf +inf, which shows 160 ( < 190)
- check the system call with sudo strace -c -p 22549 for a minute, the result as the following:
- check the system files open limits with : sudo sysctl -p | grep file, which shows: 65535
- check process files open limits with: cat /proc/22549/limits | grep -E 'files | Soft', which shows:
3. check the process open files number with ls -l /proc/22549/fd | wc -l: 145
在 2020年3月2日星期一 UTC+8下午7:40:11,Integr@te System写道:
4. check the cpu and io stat with iostat -ctz:
5. check the net stat with netstat -ano | grep daphne.sock (because ubuntu do not support the b parameter): which show 133, 1 is listening status, 132 is connected status.
在 2020年3月2日星期一 UTC+8下午7:40:11,Integr@te System写道:
Hi Fogmoon,Plz show again your image file's result and addition checkiostat -ctznetstat -anobto see more root cause.Dont for get update python version.Nice.On Mon, Mar 2, 2020, 13:32 Fogmoon <ifog...@gmail.com> wrote:Hi,--Could you please give some suggestions to inspect the high CPU (most time above 90% and some time above 100%) consumed by Daphne.Environment:
- OS: Ubuntu 18.04.1 LTS x86_64 GNU/Linux
- Django: 2.1.1
- Daphne: 2.3.0
- Channels: 2.2.0
- channels-redis: 2.4.0
Just use the Daphne as the websocket server with redis as the Channel layer.Now I do the following steps:
- top command show the daphne process consume high cpu
- check the thread numbers with ps -o thcount 22549, which shows 40.
- check the websocket connected numbers with redis cli: ZCOUNT asgi::group:USER_MESSAGE -inf +inf, which shows 190
- check the system call with sudo strace -c -p 22549 for a minute, the result as the following:
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 django...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/913143a8- .c8c8-47ce-a96d-6c9d349eac6a% 40googlegroups.com
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 django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9120a9df-4879-4769-bf91-c2c6c0bf3642%40googlegroups.com.
No comments:
Post a Comment