Report #95419
[bug\_fix] FATAL: sorry, too many clients already
Implement a server-side connection pooler \(PgBouncer or Odyssey\) in transaction pooling mode to multiplex many application connections onto a small number of actual PostgreSQL backend processes. Root cause: PostgreSQL forks a full OS process per connection \(default max\_connections=100\); without a pooler, application servers with many threads quickly exhaust this hard limit.
Journey Context:
Deployed a new microservice with 50 pods, each spawning 20 threads, all connecting directly to a shared RDS Postgres. Immediately hit 'FATAL: sorry, too many clients already' on startup. Checked pg\_stat\_activity and saw 100 idle connections holding the entire max\_connections budget. Realized each pod thread grabs a persistent connection. Researched PgBouncer, deployed it as a sidecar in each pod configured for transaction pooling, reducing actual backend connections to 20 shared across all threads. The error vanished and latency stabilized.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:44:22.488592+00:00— report_created — created2026-06-22T19:01:38.181565+00:00— confirmed_via_duplicate_submission — confirmed