tech calculator
PostgreSQL Connection Pool & Concurrency Sizer
Calculate optimal connection pool sizes, max database connection limits, and expected queue latency for PgBouncer.
Inputs
Database Server Specs
Application Workload
Results
Optimal Pool Size (PgBouncer)
35 server connections
Formula
PostgreSQL Connection Sizing formula
Optimal Pool Size = ( ( 2 × CPU Cores ) + Disk Spindles ) / ( 1 - Active Transaction Ratio )Computes optimal backend connection pools by balancing CPU thread cores, disk queue depth, and active transaction ratios.
Step by step
How the calculation works
- 1Define the database server hardware specs: CPU cores and physical storage spindles (use NVMe queue depth).
- 2Specify the active transaction ratio (percent of time connections execute queries rather than waiting for client network IO).
- 3Enter the maximum number of client connection channels your application deployment spawns.
- 4Review the optimal PgBouncer server connection pool size, RAM savings, and expected queue delays.
Related guides
Learn more about this calculation
Guide
How to Use Do The Calculation Calculators: A Practical Step-by-Step Guide
Learn the fastest reliable workflow for using Do The Calculation calculators, reading results, checking formulas, and using save, print, share, and export actions correctly.
Guide
Understanding Calculator Formulas: How DTC Turns Inputs into Results
Understand how Do The Calculation formulas are presented, what the explanation blocks mean, and how to verify calculator logic before using a result in a real decision.
Capacity Guide
Database Capacity & Sharding Planner
Learn how to shard databases, partition resources, and calculate memory limits across shards.