Database pool sizing from connection hold time

A service starts 450 database operations per second. Requests hold a connection for 40 ms at p95, and 32 connections are available to this service.

Jump to results

Inputs

Peak traffic and latency
req/s
×
ms
ms
ms
Pool sizing

Measure residence time at the boundary that owns the slots, such as database connection hold time.

%

Results

Runs in your browser
In flight at p95 duration
18requests
Pool utilization at p95
56.25%
Original traffic at saturation
800req/s

The p95 scenario is within the target. Check burst behavior and the p99 duration case.

Queue amplification as utilization rises
Illustrative latency by pool utilizationp95 reference duration 40 ms. 56.25 % modeled pool utilization.40 ms160 ms280 ms400 ms0%25%50%75%100%Modeled utilization 56.25 %
Detailed results
Effective arrival rate450 req/s
In flight at p50 duration5.4 requests
In flight at p99 duration42.75 requests
Slots at 65% target28 slots
Unused p95 pool share43.75 %
Illustrative queue multiplier2.286 ×

What to try

The p95 case uses about 56% of the pool. Increase p95 while keeping the traffic fixed to model a release that holds transactions open longer.

How the estimate works

In-flight requests L = arrival rate λ × time in system W

The effective arrival rate includes retries. The three concurrency values are separate what-if calculations that use p50, p95, and p99 as fixed durations. Little’s Law itself connects steady-state averages, so these estimates have no concurrency percentile guarantee.

Pool utilization uses the p95 planning duration. The saturation ceiling is the original request rate that would keep every slot occupied at that fixed duration. Slots needed at a target utilization are rounded up.

The curve is a normalized M/M/1 illustration, 1 ÷ (1 − utilization). Real multi-worker queues, burstiness, and load-dependent latency can shift the knee. The curve clamps the vertical scale at 10× for readability.

Frequently asked questions

Should waiting for a PostgreSQL connection count as connection hold time?

Start timing once a connection is allocated and stop when it is released. Track acquisition waiting separately to see when the pool is already congested.

Why can a larger database pool lower query throughput?

More concurrent queries can compete for locks, CPU, and disk. Test the database while raising slots and watch for rising execution time.

Open API throughput & concurrency calculator