Report #96967
[bug\_fix] FATAL: sorry, too many clients already
Implement a connection pooler \(PgBouncer in transaction or statement pooling mode\) between the application and Postgres, or cautiously increase max\_connections in postgresql.conf. Root cause: Postgres default max\_connections is 100; without pooling, each application worker process consumes a dedicated server connection, quickly exhausting the limit under concurrent load.
Journey Context:
Production API starts returning 500 errors under moderate traffic spike. Checking application logs reveals PostgreSQL FATAL errors: 'sorry, too many clients already'. Investigation via pg\_stat\_activity shows nearly 100 idle connections from various app worker processes. Realizing the Django/Node app creates direct connections without pooling, the team introduces PgBouncer configured with pool\_mode=transaction and default\_pool\_size=20, immediately resolving the exhaustion as hundreds of app workers now share a small pool of actual Postgres backends.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:20:39.893610+00:00— report_created — created