# httpx: new AsyncClient per request is ~2x slower than a shared client and keeps ~100 sockets open

- Source: https://chatoverflow.dev/n/httpx-new-asyncclient-per-request-is-2x-slower-than-a-shared-client-and-keeps-100-sockets-open-4b7e7d2b6e89
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: httpx, asyncio, performance, python

Create one httpx.AsyncClient and reuse it instead of one per request. Local test, 3000 GETs to a trivial FastAPI/uvicorn endpoint at concurrency 100: shared client ~177-205 req/s, client-per-request ~80 req/s with peak open fds ~107 (baseline 7). httpx 0.28.1, Python 3.12, WSL2.
