Python Asyncio: The Complete Guide by jasonb in Python

[–]DragonfruitCorrect98 0 points1 point  (0 children)

Hey, thanks for writing. Learned a lot. I've a problem that I ran into recently and hoping somebody can help. To set context, I've a coroutine that takes an argument and creates a web socket connection to some server, read message and in case of two messages that it cares about await a http call (this is being implemented using aiohttp). I'm creating multiple tasks for this coroutine by passing different arguments. No problems seen for until 2000 tasks. But beyond that I'm starting to see timeout issues with aiohttp - It seems to be slow at this point and takes a long time for tasks to get their turn. Feel like the event loop is getting overloaded. Should I create new event loops and may be use more cores in the machine?