-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
100% CPU usage with idle websocket #1955
Comments
I can confirm it's still an issue on master, commit 6b85bcd |
It seems like a problem related to keep-alive. When I tested the code above,
|
should be fixed in master |
Fantastic! Thank you all for your time! |
I have found that this still results in a 100% cpu usage situation after the default timeout of 75 seconds, using it in combination with python-socketio. If needed, I can provide new evidence. aiohttp version 2.3.1 |
Same issue happened to me, any hint on how to debug this issue? |
@ericdevries @zTrix could you provide reproducible example? @zTrix do you use python-socketio as well? |
@fafhrd91 sure, I will create one tomorrow and attach it to this ticket |
@fafhrd91 No I didn't use python-socketio. In my case I just started an server with websocket, and diving into |
Wild idea: disable HTTP keepalives after websocket connection establishment. They are useless, isn't it? |
Also looks like |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
Fairly standard websocket server/client setup, but with session, results in 100% CPU usage.
get
request (to the same endpoint) before a new request to start a websocketNote that removing the
get
request seems to avoid the problem.Expected behaviour
Low CPU usage when idle
Actual behaviour
Worker process suddenly goes to 100% CPU usage, confirmed with htop.
Steps to reproduce
Server
worker
Run server + worker and wait a few minutes. Eventually the server process will eat one core. Remove the session.get and it does not happen.
Your environment
I've reproduced this, so far, on:
Using
strace
, all I can see is highly frequentepoll_wait
calls returning 0. My attempts withpyrasite
andgdb-python3
yielded nothing useful.I'm still yet to try
ipdb
and try to look through the source.The only thing I can find that is even remotely similar is https://groups.google.com/forum/#!topic/libuv/opFk74lww7k .
Otherwise my experience with
aiohttp
has been fantastic. Thanks for a great library.The text was updated successfully, but these errors were encountered: