Report #74547
[bug\_fix] FATAL: sorry, too many clients already \(Postgres\)
Implement a connection pooler \(PgBouncer or RDS Proxy\) or an in-application pool \(e.g., pg.Pool\) to multiplex many application connections over a small, fixed set of actual Postgres connections. Increasing max\_connections is a temporary band-aid.
Journey Context:
You deploy a Node.js app to AWS Lambda without a pooler. Each cold start creates a new pg.Client. After 100 concurrent invocations, new connections fail with 'sorry, too many clients already'. Checking pg\_stat\_activity shows 100 idle connections from your Lambda IPs. You realize serverless environments need external pooling because they can't share in-memory pools across instances. You add PgBouncer in transaction mode between the app and RDS. The error stops because PgBouncer maintains only ~20 actual Postgres connections while handling thousands of Lambda client requests.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:43:40.897714+00:00— report_created — created