{{ summaryTitle }} {{ summaryValue }} {{ summaryLine }} {{ badge.label }} {{ badge.value }} {{ summaryAnnouncement }}
Database pool and server capacity inputs
Use per worker when every process owns a pool; use per app instance for one shared pool per replica.
Enter the normal replica count before temporary rollout overlap.
instances
For shared instance pools, this remains descriptive and does not multiply database sessions.
workers
Use the configured maximum from the application pool or server-side pooler.
connections
Use the effective limit for the database, role, user, or pooler boundary being planned.
slots
Must be lower than DB max connections.
slots
This affects the peak model; the full-pool check still uses 100%.
{{ peak_usage_pct }}%
The reserve-aware hard and peak-fit caps preserve this target.
{{ target_headroom_pct }}%
{{ workflowFeedback }}
Used only to identify exported planning documents.
Keep zero when old and new replicas never overlap.
extra
Do not double-count sessions already included in the reserved total.
slots
Zero disables the optional active-query advisory.
cores
Add only a measured I/O-wait allowance; this does not change connection capacity.
slots
{{ capacityExportStatus }}
MeasureValueMeaningCopy
{{ row.label }}{{ row.value }}{{ row.context }}

{{ item.title }}

{{ item.text }}

{{ chartExportStatus }}
{{ scaleExportStatus }}
App instancesPool holdersHard cap / holderPeak-fit cap / holderCopy
{{ row.instances }}{{ row.holders }}{{ row.hardCap }}{{ row.peakFitCap }}

A small pool setting can become a large database commitment once it is repeated across replicas and worker processes. Twelve application instances with four workers each create 48 pool holders when every worker owns its own pool. A limit of eight connections per holder can therefore expose 384 database sessions before migrations, monitoring, administration, and rollout overlap are counted.

Connection pooling keeps sessions warm and reuses them, avoiding the setup cost of opening a new database connection for every request. The pool also acts as a queue when demand exceeds the number of available sessions. A pool that is too small can make requests wait; a pool that is too large can move the queue into the database, where excessive concurrency consumes memory and leaves less room to recover from a traffic spike or a slow-query incident.

The most important planning distinction is ownership. A shared pool per application instance grows with the replica count. A separate pool inside every worker grows with both replicas and workers. Server-side poolers may add another boundary because their limits can apply to each user and database pair rather than to the application as a whole.

Connection-pool planning questions and their effects
Planning questionWhy it changes the answer
Who owns a pool?Determines whether workers multiply the number of holders.
Which database limit applies?The effective ceiling may belong to the server, role, database, or pooler.
What else uses connections?Jobs, monitoring, and operator sessions consume the same usable budget.
Can releases overlap?Old and new replicas may hold pools at the same time during a rollout.

A capacity result is a planning ceiling, not a performance optimum. The database may reach a CPU, memory, lock, or I/O bottleneck long before every connection slot is occupied. Measure waiting requests, active queries, transaction time, and database saturation under representative load before treating a calculated cap as a production setting.

How to Use This Tool:

Start with the boundary that actually limits the application, then model normal traffic and temporary scale separately.

  1. Choose Pool ownership from the application architecture. Select Per worker process only when every worker creates an independent pool; otherwise use Per app instance for one shared pool per replica.
  2. Enter App instances, Workers per instance, and Pool size per holder. Use the normal steady-state replica count. The worker count remains descriptive when the pool is shared per instance.
  3. Set DB max connections and Reserved connections from the effective database, role, user, or pooler limit. Add other active clients that must share the remaining budget.
  4. Choose Expected peak pool usage and Target free headroom. Add Deploy surge instances when old and new replicas overlap during rollout.
  5. Read Sizing review before adopting a cap. Resolve an over-capacity result first, then compare the hard and peak-fit per-holder caps with observed connection demand.

Interpreting Results:

Peak ready means both the modeled peak and the full configured pool stay within usable connections while preserving the requested reserve. Reserve review means capacity is not necessarily exceeded, but at least one normal, full-pool, or rollout scenario falls below the reserve target. Over capacity means the normal peak or full configured ceiling exceeds the usable database slots.

  • Use Expected peak headroom to judge the normal demand assumption.
  • Use Full-pool headroom as the failure-pressure check because a retry storm or slow work can fill every configured slot.
  • Use Surge headroom when deployments or autoscaling temporarily increase the number of holders.
  • Treat Peak-fit cap per holder as assumption-dependent. The Hard cap per holder is the safer ceiling when every pool could fill.

Technical Details:

Capacity is split into a holder model and a database budget. Pool ownership determines the holder count; the database ceiling and reserved slots determine what remains available to applications. Other active clients are then removed before a per-holder cap is calculated.

Formula Core:

For a per-worker pool, each instance contributes one holder per worker. For a shared instance pool, each instance contributes one holder.

H=I×M,M={Wper worker1per instance

The configured ceiling is the number of holders multiplied by the pool size. Peak demand scales that ceiling by the expected-use fraction and adds other clients.

C=H×P,Tpeak=C×u+O

Usable connections exclude reserved slots. The requested headroom is rounded upward to a whole connection, while caps are rounded downward so the result never exceeds the budget.

U=DR,B=max(0,UUhO),Phard=BH
Symbols used in database connection pool formulas
SymbolMeaningUnit
HPool holderscount
IApplication instancescount
WWorkers per instancecount
PPool size per holderconnections
D, RDatabase maximum and reserved slotsconnections
u, hPeak-use and target-headroom fractionsratio
OOther active clientsconnections

The peak-fit cap divides the same budget by H × u instead of H. Rollout calculations replace the normal instance count with normal instances plus surge instances. The scale table repeats these cap equations across increasing replica counts.

Status and advisory rules:

Connection pool status and advisory rules
ResultExact condition
Over capacityExpected peak headroom < 0, or full-pool headroom < 0.
Reserve reviewAny checked peak, full-pool, or enabled surge headroom is below the rounded target reserve, or the active-query advisory is triggered.
Peak readyNo over-capacity or reserve warning condition is present.
Active-query advisoryWhen physical cores are supplied, expected peak pool draw is more than twice 2 × cores + I/O wait allowance.

The active-query advisory is a rough concurrency signal, not a database throughput formula. Idle and waiting connections may occupy pool slots without consuming CPU, while a smaller number of expensive queries may saturate the server.

Limitations:

The model budgets connection slots; it does not predict query latency, transaction duration, lock contention, memory per backend, pool wait time, or workload throughput.

  • Measure the real number of independent pools. Multi-tenant database/user pairs can create more holders than the application replica count suggests.
  • Keep administrative and failover capacity outside the application budget.
  • Recalculate after changing worker topology, autoscaling limits, pooler mode, database limits, or rollout strategy.

Worked Examples:

Worker-owned pools with a protected reserve

Twelve instances, four workers per instance, and eight connections per holder produce 48 holders and a 384-connection ceiling. With a database maximum of 500, 80 reserved slots, 70% expected use, and 15% target headroom, the usable budget is 420 connections and the target reserve is 63. Expected peak draw is 268.8 connections, but the full-pool headroom is only 36, so the result is Reserve review. The hard cap is seven connections per holder.

One shared pool per replica

Twelve shared instance pools of 16 connections produce a 192-connection ceiling. Against 270 usable slots, 20 other clients, 60% peak use, and 10% target headroom, expected peak total is 135.2 and full-pool total is 212. Both preserve the 27-connection reserve, so the result is Peak ready.

FAQ:

Should reserved connections include only database superuser slots?

Use the total portion of the effective connection limit that the application must not consume. That may include emergency database slots, operator access, or a reserve imposed by a role, database, or pooler policy.

Why can a server-side pooler change the holder count?

Some poolers create separate server pools for combinations such as database and user. Count those independent pools when they can be active together; counting only application replicas can understate the database commitment.

References: