Code Room
On-callMediumoc-g233
Subject Connection pool exhaustionLevel Mid–Senior~30 minCommon in Databases & SQL interviewsIndustries Technology, Software development

Question

Postgres behind pgBouncer in `transaction` pooling mode. After moving an app to a serverless platform (lots of short-lived function instances) the app started intermittently failing with 'prepared statement "S_3" does not exist' and occasionally 'no more connections allowed'. The DB itself is lightly loaded. pgBouncer's `SHOW POOLS` shows `cl_active` high and `sv_active` low, with `cl_waiting` climbing during bursts. Triage and fix.

What a strong answer looks like

Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.

Diagram & narrate the incident
Loading whiteboard…
Run or narrate your approach, then ask the coach.