Report #72360
[bug\_fix] FATAL: sorry, too many clients already
Implement a connection pooler \(PgBouncer, pgpool, or built-in pool\) and ensure applications close connections properly. Root cause: PostgreSQL creates a backend process per connection and max\_connections is limited \(default 100\); without pooling, each app thread/process creates direct connections exhausting the limit.
Journey Context:
Deployed 20 Kubernetes pods running Go microservices, each spawning 10 worker threads. Immediately hit FATAL errors on Postgres. Checked pg\_stat\_activity and saw 200\+ idle connections from app IPs. Realized each pod was using lib/pq with sql.Open but never closing connections, and no pooling between pods. Implemented PgBouncer in transaction mode as sidecar, reducing active Postgres backends from 200\+ to 12, eliminating the connection exhaustion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T04:02:42.508965+00:00— report_created — created