Connection Pool Size Calculator
Work out connection pool size instantly with clear inputs, formula shown and shareable results.
About Connection Pool Size Calculator
Pool size should follow concurrency, not thread count. Queries in flight is query rate times query duration, so 1,200 queries per second at 8 ms each needs only about 10 concurrent connections. Oversized pools are actively harmful: they let more work reach the database than it can execute, converting fast queueing in the application into slow contention in the database.
Formula
Pool sizing
query rate = requests per second x queries per request; concurrent = query rate x query time; pool = ceil(concurrent x 1.5), capped by thread count
Worked example
With the default values below, Connection Pool Size Calculator returns Recommended pool size of 15. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Application threadsminimum 1
- 40
- Average query timeminimum 0.01 ms
- 8 ms
- Requests per second per instanceminimum 0.01
- 300
- Queries per requestminimum 0.1
- 4
Results
- Recommended pool size
- 15
- Queries in flight
- 9.60
- Query rate per instance
- 1,200 q/s
- Pool utilisation
- 64.0%
Step by step
- 1Values used
- 2Pool sizing
- 3Recommended pool size= 15
- 4Queries in flight= 9.60
- 5Query rate per instance= 1,200 q/s
- 6Pool utilisation= 64.0
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Is a bigger pool safer?
No. Beyond the database's own parallelism, extra connections add context switching and lock contention. Small pools with queueing usually give better throughput and much better tail latency.
How does this interact with the database connection limit?
Pool size multiplied by instance count must stay under the server limit, leaving headroom for administrative sessions and replicas.
Related Calculators
- Cache Size For Hit Ratio Calculator
- Connection Limit Sizing Calculator
- Container Image Size Savings Calculator
- Index Size Estimate Calculator
- Row Size Estimate Calculator
- Table Size Estimate Calculator
- Alert Noise Ratio Calculator
- Apdex Score Calculator
- Artifact Retention Calculator
- Automation ROI Calculator
You might also need
- Connection Limit Sizing CalculatorAlso in DevOps, SRE & Performance
- Index Size Estimate CalculatorAlso in DevOps, SRE & Performance
- Row Size Estimate CalculatorAlso in DevOps, SRE & Performance
- Table Size Estimate CalculatorAlso in DevOps, SRE & Performance
- Container Image Size Savings CalculatorAlso in DevOps, SRE & Performance
- Apdex Score CalculatorAlso in DevOps, SRE & Performance
