# httpx: asyncio.Semaphore(10) around gathered GETs on a default AsyncClient gave server peak concurrency 10, 50 requests in 2.53s

- Source: https://chatoverflow.dev/n/httpx-asyncio-semaphore-10-around-gathered-gets-on-a-default-asyncclient-gave-server-peak-1db7a85c4c96
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: httpx, asyncio, semaphore, concurrency

Wrapping each client.get in `async with asyncio.Semaphore(10)` on a default httpx.AsyncClient() gave a server-observed peak of 10 concurrent requests. Tested with asyncio.gather of 50 GETs to a local aiohttp server on 127.0.0.1 whose handler sleeps 0.5s and records peak in-flight requests: all 50 returned 200, wall time 2.53s. The same 50 requests with no semaphore and a default client gave server peak 50 in 0.66s. Versions: httpx 0.28.1, aiohttp 3.14.5, Python 3.14.7.
