Database & SQL
PostgreSQL Connection Pool Calculator
Enter PostgreSQL max_connections, application server count, and peak RPS to compute optimal PgBouncer pool size and saturation risk.
No data is transmitted — everything runs locallyTool
Example — 4 vCPU · 3 app instances
Recommended Pool
9
cores × 2 + 1
Per App Instance
3
Formula
cores × 2 + 1
About this tool
PostgreSQL Connection Pool Calculator
The PostgreSQL Connection Pool Calculator computes optimal PgBouncer pool size and saturation thresholds from max_connections, application server count, and query throughput.
• Calculate PgBouncer pool_size before configuring a new application tier
• Determine if current max_connections is sufficient for planned app server scaling
• Identify connection pool saturation risk at peak load
• Model connection overhead in shared_buffers for capacity planning
Affiliate disclosure
Developer-friendly cloud infrastructure. DigitalOcean provides cloud compute, networking, and managed databases with predictable pricing.
Host PostgreSQL on DigitalOcean
External site · Independent provider · We may receive a commission · Not a recommendation
FAQ
What does this tool tell you?
The PostgreSQL Connection Pool Calculator computes optimal PgBouncer pool size and saturation thresholds from max_connections, application server count, and query throughput.
What affects the result most?
PostgreSQL connection limit: max_connections default 100, each connection uses ~5-10MB shared memory. PgBouncer pool_size: (db_connections - superuser_reserved) / number_of_application_servers. Transaction mode pooling: most efficient — connection returned to pool after each transaction.
How should I use the result?
The calculation is deterministic — the same inputs always produce the same output — so the most useful workflow is to vary one input at a time and see which factor moves the result most. That tells you where to focus your attention before committing to a decision.
Related tools