ALLOCATE · OBSERVE · COMPARE
Connection pools: occupancy, queues and timeouts
Follow each request from arrival to completion, rejection or timeout.
Your experiment
Treat each slot as one checked-out connection. Increase A hold time, reduce the waiting cap, then compare pool partitions. Inspect which requests are rejected, wait, finish or time out.
Play inspects 20 modeled ticks over one minute at 1×. Pause, slow to 0.5×, restart with the same inputs, or seek to any state. Input changes recompute without autoplay.
Event ordering and limits
At each tick: finish due work, expire overdue requests, dispatch older waiting work, then offer new A requests followed by B. A completion exactly at its deadline wins. Arrivals stop after tick 11; the view ends at tick 20 and may still contain pending work. Queue caps exclude active work and allow direct handoff into an eligible free slot. Borrowing never preempts. Identical slots are visited in numeric order.
Outcomes at the inspected tick
Scroll the metric tables horizontally on narrow screens to inspect every column.
Full-window calculation
This is the exact result of the selected fixture through tick 20, available before playback. Completion rate includes all offered requests, including rejected and timed-out requests. p95 uses the nearest-rank value among completed latencies only; it excludes failures and is not the gate. A gate remains pending while a request is still waiting or running.
Every request and resource
Scope and references
The connection analogy assumes immediate resource release on timeout. Real driver cancellation, rollback, socket cleanup and server-side query work can continue and need separate handling. No database connection is made.
Deterministic teaching workload, not measured throughput or a reliability guarantee. Logical tenant partitions do not establish security isolation.
Connections are occupied resources, not decorative counters
The pool contains a fixed number of identical resources. Two application tenants submit requests during ticks zero through eleven. Each admitted request holds one resource until completion or its total timeout; queued requests hold no resource but still spend their timeout budget. The diagram, request inspector and result tables expose waiting, running, completed, rejected and expired work. A high completed-request latency score alone is misleading when many requests were rejected or timed out. Compare the entire offered workload, including work still pending when the finite experiment ends.
Set demand, service and waiting limits
Total resources sets pool size. Slots reserved for A divides partitioned policies and leaves at least one home resource for B. A arrivals per tick and B arrival every N ticks set the offered load. A resource hold and B resource hold specify modeled service time. Stall all A calls until timeout prevents A from finishing normally. A total timeout and B total timeout begin at arrival, not at acquisition. Maximum waiting per tenant caps each queue separately; zero still permits a direct handoff to an eligible free resource. Completion target changes the final gate, not the dispatch schedule.
Compare ownership policies under a stalled workload
Set four resources, two reserved for A, two A arrivals each tick and one B arrival every three ticks. Stall A calls. Compare shared FIFO against strict tenant partitions while leaving the service and timeout values unchanged. FIFO can let A occupy resources B needs; strict partitions retain B home slots but may leave capacity unused when its queue is empty. Shared round-robin changes the next tenant dispatched, not the owner of a running resource. Partitions with idle borrowing allows foreign work on an unused home slot, but that work is not preempted when home demand returns. Lower A timeout and inspect when its resources actually become free.
Read exact outcomes and implementation limits
Play spreads the twenty-tick trace over sixty inspection seconds. Pause holds it; Next tick advances the model; Restart rewinds; Speed changes viewing pace; Inspection scrubs. Choose a request to inspect its arrival, resource ownership and terminal outcome. Completion at a deadline is processed before expiration. Completion rate includes all offered requests; p95 includes completed requests only. The target remains pending if work is still running or waiting at tick twenty. This teaching pool releases a timed-out running resource immediately. Real database drivers may need explicit cancellation, rollback or connection disposal before reuse, so the fixture is not a safe implementation recipe. It omits connection creation, transaction state, database locks, queries, network partitions and external effects; no database is contacted.