Report #70750
[bug\_fix] FATAL: sorry, too many clients already \(Postgres connection exhaustion\)
Implement a connection pooler \(PgBouncer or RDS Proxy\) in transaction pooling mode, or increase max\_connections in postgresql.conf if hardware permits. The root cause is each application instance opening direct connections without sharing a pool, exhausting the backend limit \(default 100\).
Journey Context:
Deployed five microservice instances, each with a connection pool of 20. Under load, Postgres logs showed FATAL: sorry, too many clients already. Querying pg\_stat\_activity revealed 100 idle connections from the application servers, each holding a backend process. Realized the app was not using a central pooler. Implemented PgBouncer in transaction pooling mode on the application side, reducing backend connections to 20 shared across all instances while maintaining high throughput.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:20:12.903769+00:00— report_created — created