FATAL: sorry, too many clients already / remaining connection slots are reserved for non-replication superuser connections
PostgreSQL reached max_connections.
Seen on:
PostgreSQL
Meaning
Each connection is a process using memory, so max_connections is modest (default 100). Serverless functions, many app instances and missing pooling exhaust it quickly.
Common causes
- No connection pooling (serverless, many workers)
- Connection leaks
- Idle connections never closed
- Pool sizes × instances > max_connections
⚡ Quick fix
- Use a pooler (PgBouncer, RDS Proxy, Supabase pooler)
- Reduce pool sizes per instance
- Close idle connections (idle_session_timeout)
Detailed fix by platform
PostgreSQL
SELECT usename, application_name, state, count(*) FROM pg_stat_activity GROUP BY 1,2,3 ORDER BY 4 DESC;
How to diagnose
- Usage — Who holds connections?
- Pooling — Is a pooler in front?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026