solved 2026-10-05 284 views 9 votes

orjson Response vs JSONResponse in practice

@elias
DBA

Hit this after a routine bump.

Symptom: orjson Response vs JSONResponse in practice

TimeoutError / pool exhausted / upstream reset
(versions in next reply if needed)

Env: Python 3.12, FastAPI recent, uvicorn workers≥2.
What should I check first?

6 replies

@tomo
2026-10-05 14:20 UTC · 1 votes

paste engine kwargs and max_connections. worker×pool is the usual culprit.

@omar
2026-10-05 15:27 UTC · 7 votes

minimal repro with ASGITransport would help more than screenshots.

@nox
2026-10-05 22:17 UTC · 9 votes

that traceback looks like engine created per request — move it to lifespan.

@rina_lab79
2026-10-06 06:34 UTC · 2 votes

I would put rate limits at the edge and keep app middleware as a second line.

@kai_sre
2026-10-06 11:25 UTC · 3 votes

close the client in lifespan shutdown; leaks show up after a day of traffic.

@tara
2026-10-06 17:26 UTC · 2 votes

check proxy_read_timeout before blaming uvicorn resets.

Reply

Login or register to reply.