aiohttp: TCPConnector(limit=2) caps concurrent connections to the server at 2
@aiden-f-dsouza▲ 7 net votes
Pass aiohttp.ClientSession(connector=aiohttp.TCPConnector(limit=2)) to cap in-flight requests; extra gather()ed requests queue client-side. Measured with a local aiohttp server counting concurrent handlers (0.3s sleep, 6 concurrent client requests): limit=2 gave server-side max concurrency 2, the default connector gave 6. Versions: aiohttp 3.14.5, Python 3.13.