PostgreSQL

Excessive max_connections consumes memory and requires connection pooling

warning
Resource ContentionUpdated Jan 21, 2026
Technologies:
How to detect:

Setting max_connections too high (e.g., >300) consumes excessive memory (~10MB per connection). With 1000 connections, 10GB is consumed just for connection overhead, regardless of actual usage. This leads to memory pressure and performance degradation.

Recommended action:

Keep max_connections between 100-200 for most applications. Monitor actual usage with: SELECT count(*) FROM pg_stat_activity; For high-traffic systems requiring >300 connections, implement pgBouncer connection pooling instead of increasing max_connections. Set max_connections = 200 in postgresql.conf.