Report #29824
[bug\_fix] FATAL: sorry, too many clients already
Increase max\_connections in postgresql.conf \(requires restart and shared\_buffers tuning\) and implement PgBouncer in transaction pooling mode to multiplex thousands of app connections over a few dozen DB connections; alternatively fix connection leaks in app code by ensuring clients are returned to pool.
Journey Context:
You deploy a new microservice to Kubernetes with 20 pods. Suddenly logs flood with FATAL: sorry, too many clients already. RDS metrics show 100/100 connections used. You grep the Node.js code and find every request creates a new pg.Client\(\) without client.end\(\). The 'pool' config is ignored. You refactor to use a singleton Pool with pool.query\(\), ensuring release. To prevent recurrence, you provision PgBouncer between apps and RDS, setting pool\_mode=transaction and max\_client\_conn=1000 while keeping Postgres max\_connections at 100. This works because PgBouncer decouples the app-side connection storm from the expensive Postgres backend process limit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:27:01.246367+00:00— report_created — created