Finding the bottleneck for asyncio tasks slowing down overall

97 views Asked by At

For python asyncio, what are good tools do debug performance bottlenecks? I have a quart webserver that is the frontend for a backend that holds SSH connections (via paramiko) to multiple devices (about 30 or 40). What I notice is that, once all those connections are up and running, the web frontend seems to be slowing down a lot. Requests take a long time to complete and I am seeing tons of warnings in the console where asyncio warns about slow tasks.

The problem is, a lot of the methods that asyncio warns about don't really have anything that is blocking the main thread anymore. I have tried yappi to search for slowness on the main thread but it doesn't help much.

I am starting to wonder if this is either a general runloop starvation and I simply have too many tasks, or if there are some other resources that get constraint here that could cause this.

My problem is a lack of debugging tools. I would love to see a graphical representation of which method takes how long and what it's waiting for.

0

There are 0 answers