{{ result.summaryTitle }}
{{ result.primaryDisplay }}
{{ result.secondaryText }}
{{ result.statusText }} {{ result.peakBadge }} {{ result.hardCapBadge }} {{ result.scopeBadge }}
Workers {{ dbPoolStage.workerLabel }} Pool {{ dbPoolStage.poolLabel }} DB limit Reserve
Database connection pool inputs
Use per worker for frameworks where every process owns its own pool; use per instance when the instance shares one pool.
Enter the steady-state replica count before any rollout surge.
instances
This multiplies the pool only when Pool scope is per worker process.
workers
Use the configured maximum pool size from the application or pooler.
connections
Enter the configured server limit before subtracting admin, monitoring, and maintenance slots.
slots
Subtract anything that should not be consumed by application pools.
slots
Use observed active-connection ratio at peak, or a conservative planning estimate.
%
Use this as an operational reserve for bursts, failover, slow query pile-ups, and emergency sessions.
%
Use the service, cluster, schema, pool, or environment name.
Leave 0 when no overlap is expected; positive values model a temporary scale-out burst.
extra
Keep 0 when the reserved-connection field already includes this demand.
slots
This does not change slot math; it adds a throughput caution when active query demand dwarfs the database.
cores
Use 0 for fully cached or SSD-heavy data sets unless measured waits justify more.
slots
MetricValueDetailCopy
{{ row.label }} {{ row.value }} {{ row.detail }}
CheckStateRecommendationCopy
{{ row.check }} {{ row.state }} {{ row.recommendation }}
ScenarioPool holdersMax pool/holderBudget noteCopy
{{ row.scenario }} {{ row.holders }} {{ row.cap }} {{ row.note }}

        
Customize
Advanced
:

Introduction:

A database connection pool keeps database sessions open so an application can reuse them instead of creating a new session for every request. That saves connection setup time, but it also creates a capacity promise. Each configured pool can hold a fixed number of sessions, and the database must have enough slots for every pool holder that may be active at the same time.

The risky part is multiplication. A pool size of 8 may mean 8 total connections, 8 connections for each application replica, or 8 connections for each worker process inside each replica. Twelve replicas with four workers each can therefore represent 48 separate pool holders. At a pool size of 8, the database could see 384 application-held sessions before reporting tools, migration jobs, monitoring agents, manual admin sessions, or rollout overlap are counted.

app workers instances x workers pool ceiling holders x cap peak use may be lower DB slots usable, reserve, over
Connection planning follows the path from application workers to pool holders, then into usable database slots and reserve.

Good pool sizing protects both latency and recovery room. Too small a pool can make application requests wait even when the database is healthy. Too large a pool can let slow queries, leaked sessions, retry storms, or autoscaling bursts consume every database slot and block the very sessions operators need to inspect or fix the problem.

Several terms need to stay separate. Configured pool ceiling is the maximum all modeled pool holders could open if every pool fills. Expected peak draw is the planned active share during a busy but normal window. Target reserve is the connection headroom intentionally left unused. A setting can pass the expected peak check and still be fragile when a full-pool flood, rolling deploy, or reporting client consumes the reserve.

  • Replica count changes the connection budget because every replica may create another set of pool holders.
  • Worker-based runtimes can multiply demand faster than instance-level pool designs.
  • Database max-connection settings limit sessions, not useful query throughput.
  • External poolers can reduce server-side sessions, but their own per-database and per-user limits still need sizing.

A connection-pool calculation is a capacity check, not a performance guarantee. It identifies settings that are impossible, thin, or worth load-testing before production traffic discovers the limit.

How to Use This Tool:

Model the deployment shape first, then subtract database slots that should stay outside application pool demand.

  1. Set Pool scope to Per worker process when each process or runtime worker owns a separate pool. Use Per app instance when one shared pool serves the whole replica.
  2. Enter App instances, Workers per instance, and Pool size. These values drive Pool holders and Configured pool ceiling.
  3. Add DB max connections and Reserved DB connections. Reserve should cover admin access, migrations, monitoring, failover work, and other sessions you do not want app pools to consume.
  4. Set Expected peak pool usage and the headroom target. Use observed active-connection ratios when telemetry exists; otherwise choose a conservative peak percentage and verify it later.
  5. Open Advanced when rollout overlap or non-application sessions matter. Deploy surge instances models temporary replicas, Other active clients adds reporting or maintenance sessions, and DB physical cores plus I/O wait slots enables the active-query hint.
  6. Compare Pool Budget, Sizing Review, and Scenario Caps. Use Connection Budget Stack for the capacity breakdown and Instance Scale Curve to see how per-holder caps shrink as replicas increase.
  7. If the status changes to reserve review or over capacity, test a smaller pool size, fewer holders, narrower deploy surge, explicit pooler caps, or a validated database connection limit before using the setting.

Whole-number fields are floored to practical counts. Peak usage is bounded from 1% to 100%, and target headroom is bounded from 0% to 90%, so a surprising result should first be checked against those ranges and the chosen pool scope.

Interpreting Results:

Expected peak headroom is the normal-traffic check. It shows the usable database slots left after modeled active pool demand and other active clients. Full-pool headroom is harsher because it assumes every holder fills its configured pool.

Hard cap per holder is the largest pool size that keeps the target reserve if all holders fill. Peak-fit cap per holder can be higher because it relies on the selected peak-usage percentage. Trust the hard cap more when leaks, long transactions, retry storms, or slow queries are plausible.

  • peak ready means the modeled checks preserve the target reserve, but live telemetry and load tests still matter.
  • reserve review means at least one reserve, surge, full-pool, or active-query warning needs attention.
  • over capacity means expected peak demand or full-pool demand exceeds usable database slots.
  • Active-query ceiling is a throughput caution, not a server connection limit.

Technical Details:

Connection-pool capacity is dominated by holder count. The database receives sessions, not deployment intent, so the configured pool size has to be multiplied by every app instance or worker process that can open its own pool. Per-worker scope uses app instances times workers per instance. Per-instance scope uses app instances only.

The database limit is reduced before application demand is tested. Reserved connections are removed from the maximum connection count, and the remaining usable slots are compared with expected peak demand, full-pool demand, deploy surge demand, other clients, and the target reserve.

Formula Core:

The core budget subtracts reserved slots, estimates pool demand, and computes remaining headroom.

UsableSlots = DBMaxConnections-ReservedConnections PoolHolders = AppInstances×WorkersPerInstance for per-worker scope ConfiguredPoolCeiling = PoolHolders×PoolSize ExpectedPeakDraw = (ConfiguredPoolCeiling×PeakUsageFraction)+OtherClients ExpectedPeakHeadroom = UsableSlots-ExpectedPeakDraw

Reserve-aware caps subtract the target reserve and other active clients before dividing the remaining budget across holders.

TargetReserve = ceil(UsableSlots×TargetHeadroomFraction) PlanningBudget = max(0,UsableSlots-TargetReserve-OtherClients) HardCapPerHolder = floor(PlanningBudget/PoolHolders) PeakFitCapPerHolder = floor(PlanningBudget/(PoolHolders×PeakUsageFraction))

For a 12-instance service with 4 workers per instance, per-worker scope, pool size 8, 500 database connections, 80 reserved connections, 70% peak usage, and 15% target headroom, usable slots are 420. The holder count is 48, the configured pool ceiling is 384, expected peak draw is about 269, and expected peak headroom is about 151. The target reserve is 63, so expected peak demand fits, but full-pool headroom is only 36 and triggers a reserve review.

Database pool output quantities
Output Meaning What changes it
Pool holdersEntities that can own a poolPool scope, app instances, workers per instance, and deploy surge
Configured pool ceilingMaximum application pool sessions before other clients are countedPool holders multiplied by pool size
Expected peak headroomUsable slots left after modeled peak demandPeak usage percentage, other clients, and usable database slots
Deploy surgeTemporary extra demand from overlapping replicasSurge instance count and pool scope
Active-query ceilingOptional throughput caution from database cores and I/O wait allowancePhysical cores x 2, plus I/O wait slots
Database pool status rules
Status Rule Useful response
peak readyExpected peak, full-pool, surge, and active-query checks do not break the target reserve.Load-test the setting and compare it with production connection telemetry.
reserve reviewAt least one check falls below the target reserve, or active pool draw is more than twice the active-query hint.Reduce pool size, narrow deploy overlap, model other clients, or test a pooler.
over capacityExpected peak headroom or full-pool headroom is negative.Lower demand before relying on the selected database limit.

The active-query hint uses physical cores times 2 plus optional I/O wait slots. It is deliberately conservative because open sessions and useful active database work are not the same thing. Real throughput still depends on query plans, locks, transaction duration, memory, storage latency, network behavior, and the session or transaction mode of any external pooler.

Limitations:

A connection budget can reject unsafe settings, but it cannot prove that the remaining settings are fast. It models session capacity, not query throughput.

  • Long transactions, locks, slow query plans, memory pressure, and isolation-level behavior are outside the calculation.
  • Per-user, per-database, role-level, or pooler-specific caps can be lower than the server-wide connection maximum.
  • Serverless workloads and aggressive autoscaling can burst above the steady-state instance count.
  • Telemetry and load testing should confirm any setting change before database connection limits are raised.

Worked Examples:

Per-worker web tier. With 12 app instances, 4 workers per instance, pool size 8, 500 database connections, 80 reserved connections, 70% peak usage, and 15% target headroom, Pool holders is 48 and Configured pool ceiling is 384. Expected peak headroom is about 151 slots, but Full-pool headroom is 36 against a 63-slot target reserve, so the status is reserve review and Hard cap per holder is 7.

Shared instance pool. If 12 instances share one pool each, pool size 16, 300 database connections, 30 reserved connections, 20 other active clients, 60% peak usage, and 10% target headroom, Pool holders is 12. The plan keeps Expected peak headroom near 135 slots and Full-pool headroom at 58, so the status is peak ready with an 18-connection Hard cap per holder.

Rolling deploy surge. An 8-instance service with 3 workers each, pool size 6, 240 database connections, 40 reserved connections, 10 other clients, 65% peak usage, and 20% target headroom passes at steady state. Adding 5 Deploy surge instances raises surge holders to 39 and leaves about 38 surge headroom slots, below the 40-slot target reserve, so Scenario Caps shows a smaller surge cap and the status becomes reserve review.

Active-query warning. A service with 10 instances, 4 workers each, pool size 10, 650 database connections, 100 reserved connections, 25 other clients, and 60% peak usage may have plenty of connection headroom. If the database has 16 physical cores and 4 I/O wait slots, the Active-query ceiling is 36 and the 240 active pool draw is more than twice that hint, so the result warns that the pool may be too wide for a useful load-test starting point.

FAQ:

Should pool size match request concurrency?

No. Request concurrency is often higher than useful database concurrency. Use Pool holders, Expected peak pool usage, and database telemetry instead of matching every request, thread, or worker with a database connection.

Why can expected peak pass while full-pool demand fails?

Expected peak draw uses the selected peak usage percentage. Full-pool headroom assumes every holder fills its configured pool, which can happen during leaks, slow queries, long transactions, or retry storms.

How should a pooler be modeled?

Model the side that can consume server-side database sessions. If PgBouncer or another pooler limits server connections per database or user, use that effective server-side cap rather than only the application's client-side pool count.

Why reserve database connections?

Reserved connections protect access for operators, migrations, monitoring, failover tasks, and emergency fixes. The calculation subtracts Reserved DB connections before application pool demand is tested.

What should be fixed first when the status is over capacity?

Start with the largest multiplier in Pool Budget: pool scope, app instances, workers per instance, pool size, other active clients, or deploy surge. Lowering a multiplied value usually matters more than trimming one reserved slot.

Glossary:

Pool holder
An app instance or worker process that can own a configured pool.
Usable database slots
Database max connections after reserved connections are removed.
Target reserve
The minimum number of usable slots to preserve after modeled demand.
Full-pool flood
A worst-case check where every holder fills its configured pool.
Hard cap per holder
The largest per-holder pool size that preserves target reserve during a full-pool flood.
Peak-fit cap per holder
The largest per-holder pool size that preserves target reserve at the selected peak usage fraction.
Active-query ceiling
An optional throughput hint based on database physical cores and I/O wait allowance.

References: