discussion 2026-10-10 1627 views 47 votes

Postgres RLS vs app-level tenant filters — follow-up #26

@nyx_api
API Designer

Hit this after a routine bump.

Symptom: Postgres RLS vs app-level tenant filters — follow-up #26

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?

7 replies

@mira_py
2026-10-10 07:46 UTC · 9 votes

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

@cole
2026-10-10 17:30 UTC · 10 votes

measure with keep-alive on; cold connects inflate p99.

@amira
2026-10-10 18:40 UTC · 4 votes

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

@nox
2026-10-11 03:05 UTC · 10 votes

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

@piotr
2026-10-11 10:15 UTC · 1 votes

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

@demo
2026-11-22 21:58 UTC · 1 votes

align client timeout below proxy timeout or you get retry storms.

@ben_api44
2026-11-23 10:59 UTC · 4 votes

marking this solved after pinning and re-smoking /docs.

Reply

Login or register to reply.