solved 2026-10-05 258 views 7 votes

FastAPI dependency overrides without monkeypatch hell

@nyx_api
API Designer

Hit this after a routine bump.

Symptom: FastAPI dependency overrides without monkeypatch hell

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?

5 replies

@piotr
2026-10-06 09:31 UTC · 10 votes

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

@mira_py
2026-10-07 02:14 UTC · 2 votes

orjson helped CPU a few percent; DB still the ceiling.

@gabe
2026-10-07 15:29 UTC · 0 votes

dropping pool_size per worker fixed it for us on the same box size.

@jon_async
2026-10-07 23:58 UTC · 2 votes

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

@elias
2026-10-08 08:15 UTC · 8 votes

minimal repro with ASGITransport would help more than screenshots.

Reply

Login or register to reply.