-
It looks like the async websocket server we are using spending more time in FlowDataControlQueue, what does that indicate? I could reduce it by adding await asyncio.sleep(0) in websocket handlers, but not sure how many I should add ? doesn't make sense in adding everywhere. Could anyone help me on what might be happening ? Also using web.run to start the app |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 23 replies
-
Looks like the aiohttp websocket app degrade over time dropping/ delaying the tasks created from create_task api and eventually need to restart the service once every 2-3 hrs |
Beta Was this translation helpful? Give feedback.
-
You're going to have to provide some more information on what I'm looking at and what you expect to be happening... If that graph is showing amount of time the program is at a particular point in the code, then that looks pretty normal. I'm pretty sure the FlowControlDataQueue is where the socket code is handled, so whenever you are waiting on socket data it would be sitting in the code. It is not blocking or causing any performance issues, you application is simply idling at this point. |
Beta Was this translation helpful? Give feedback.
-
task_starving_test_code.zip
Since i can reproduce with the code, want to understand what exactly is helping the tasks execution with sleep(s) inside websocket reads (for loop) |
Beta Was this translation helpful? Give feedback.
-
Please give 3.10.2 a try. It should scale a bit better. There is still more to do. |
Beta Was this translation helpful? Give feedback.
-
I ended up making and using my own small WebSockets library. |
Beta Was this translation helpful? Give feedback.
-
3.11.x has replaced most of this code. The performance should be significantly improved. Please give it a try. |
Beta Was this translation helpful? Give feedback.
3.11.x has replaced most of this code. The performance should be significantly improved. Please give it a try.