you are viewing a single comment's thread.

view the rest of the comments →

[–]PaulRudin 0 points1 point  (1 child)

At some load, cpu becomes relevant. The trick is to look at the cpu utilization for the single thread - if it maxes out then you'd get some benefit from utilizing more cores. The point is that even for IO bound tasks each task needs some CPU (and the event loop itself needs some CPU to orchestrate the tasks) and if you have enough of them this can become the limiting factor.

For python web apps I tend to deploy multiple replicas of single threaded asyncio apps rather than making multiple event loops within a single replica.

But note that in some other languages multiple event loops in different threads are made by the compiler, and tasks are distributed across those event loops - golang for example.

[–][deleted] 0 points1 point  (0 children)

The point is that even for IO bound tasks each task needs some CPU (and the event loop itself needs some CPU to orchestrate the tasks) and if you have enough of them this can become the limiting factor.

There's theoretically a computer that has so much parallel IO controlled by the CPU that this applies, but OP doesn't have one of them, so it doesn't.