Queue Worker Capacity Calculator
Size a queue worker pool from busy-period arrivals, measured throughput, backlog drain time, utilization headroom, and worker limits.| Measure | Value | Planning meaning | Copy |
|---|---|---|---|
| {{ row.label }} | {{ row.value }} | {{ row.note }} |
| Checkpoint | Signal | Action | Operator note | Copy |
|---|---|---|---|---|
| {{ row.label }} | {{ row.signal }} | {{ row.action }} | {{ row.note }} |
A queue can accept work faster than its workers finish it without failing immediately. The first visible symptom may be an older-message alert, a missed email window, or a batch that keeps running after traffic has fallen. Capacity planning connects those symptoms to three quantities: new arrivals, useful completions, and the backlog already waiting.
Worker count alone says little because workers may spend time on retries, locks, slow APIs, or database contention. The useful service rate is the number of messages one worker actually completes per second under representative load. Multiplying that rate by the active worker count gives pool capacity; subtracting arrivals gives the net drain rate. A positive net drain shrinks the queue, while zero or a negative value leaves it unchanged or growing.
- Steady-state headroom
- Capacity kept above normal arrivals so bursts and slower jobs do not immediately saturate the pool.
- Catch-up capacity
- Extra service rate needed to clear existing messages within a chosen drain window.
- Scale delay
- Time before added workers begin processing, during which the current pool may reduce or enlarge the backlog.
A drain target turns “eventually” into an operational promise. A pool can have enough capacity for new arrivals yet still miss a 30-minute recovery objective because the old backlog needs temporary catch-up workers. The reverse also happens: an empty queue may pass the drain check while running too close to full utilization for safe steady operation.
Use busy-period measurements taken from the same workload and deployment shape. Daily averages hide short peaks, and throughput measured without normal retry or downstream cost can make a small pool look safer than it is. The result is a planning estimate for one shared queue with interchangeable workers; priority classes, highly variable job times, and downstream rate limits need separate evidence.
How to Use This Tool:
Start with measured busy-period rates, then add only the reserves and delays that represent a real production condition.
- Enter a traceable Queue name, the sustained Arrival rate, current whole-worker count, and completed messages per second for one worker.
- Set the current backlog and the time allowed to clear it. Choose a Utilization ceiling below 100% when the pool needs steady headroom.
- Add burst reserve, retry or overhead reserve, worker start delay, and fixed safety workers only when measurements or operating policy support them. Burst reserve raises arrivals; overhead reserve lowers useful per-worker throughput.
- Enter a positive Worker cap when quotas or downstream concurrency impose a hard limit. A cap below the recommendation produces a constrained plan instead of changing the unconstrained target.
A capped result can miss the drain window even when the recommended worker target is valid. Raise the cap, lengthen the window, or reduce load before treating the target as deployable.
- Compare Recommended target, planned drain time, and planned utilization with production queue age, retry rate, and downstream latency before changing concurrency.
Interpreting Results:
Recommended target is the larger of the catch-up worker floor and the utilization worker floor, plus any fixed safety workers. This prevents a large backlog from being hidden by a steady-state check and prevents an empty queue from being sized at nearly 100% utilization.
- Backlog not draining means current service capacity is less than or equal to modeled arrivals. There is no finite drain time while that condition continues.
- Backlog when added workers start includes the current pool's net drain during the start delay. A growing queue can therefore require more catch-up capacity after a slow scale-out.
- Planned workers equals the recommendation unless a positive cap blocks it. Read the capped drain and utilization values as the attainable outcome.
- The queueing estimate is a steady-state approximation. Compare it with observed oldest-message age or wait time before using it for a service-level commitment.
One additional worker can create a large improvement near the stability boundary because it changes net drain from very small to meaningfully positive. The sensitivity view helps expose that step, but production measurements remain the deciding evidence.
Technical Details:
The model treats arrivals and completions as continuous rates in messages per second, while workers remain whole deployable units. Burst reserve is applied to the entered arrival rate. Retry or overhead reserve is applied as a percentage reduction in each worker's useful throughput.
Formula Core:
The worker target must satisfy both the recovery window and the steady utilization ceiling. Every worker floor is rounded upward before fixed safety workers are added.
Here λ is entered arrivals, μ is entered throughput per worker, b is burst reserve percent, h is overhead reserve percent, c0 is the current pool, Q0 is starting backlog, d is start delay in seconds, T is drain time in seconds, u is the utilization ceiling as a fraction, and s is fixed safety workers. A zero arrival rate makes the utilization floor zero.
| Rule | Exact behavior | Planning meaning |
|---|---|---|
| Current drain | Finite only when backlog is zero or net drain is greater than zero. | Capacity equal to arrivals does not clear existing work. |
| Worker cap | A positive cap below the target replaces planned workers; zero means no cap. | The recommendation remains visible while charts use the attainable pool. |
| Backlog projection | Uses the current pool through the start delay, then the planned pool. | Autoscaler or warm-up lag can enlarge the catch-up problem. |
| Queueing approximation | Available only when arrivals are below total service capacity and target workers do not exceed 2,000. | Unstable or very large pools omit the Erlang C wait estimate. |
The Erlang C estimate assumes a single M/M/c queue with random arrivals, exponential service times, identical workers, no abandonment, and no priority classes. It derives wait probability, mean queue wait, and expected queued messages only at the unconstrained target; it is not used to choose the worker count.
Limitations:
Average-rate arithmetic cannot reproduce burst shape, long-tail job duration, priority scheduling, locks, or a downstream service that throttles as concurrency rises.
- Measure completed work, not merely active or available workers.
- Model materially different job classes separately when their service times or priorities differ.
- Recheck queue age, failures, retries, CPU, memory, and downstream latency after any concurrency change.
- The entered planning values are calculated in the browser and are not sent to a dedicated capacity service.
Worked Examples:
Backlog makes the drain floor decisive
At 12 messages per second, eight workers completing 2.4 messages per second provide 19.2 messages per second of capacity. An 18,000-message backlog therefore drains at 7.2 messages per second in about 41 minutes 40 seconds. Clearing it in 30 minutes requires 10 workers because the pool must cover 12 new messages per second plus 10 messages per second of catch-up work.
An empty queue still needs headroom
With no backlog, 40 messages per second, 5 messages per second per worker, and an 80% utilization ceiling, the utilization floor is 10 workers. Eight workers exactly match arrivals but leave no headroom and cannot drain a new backlog.
References:
- Erlang C, Wolfram Language & System Documentation.
- Little's Law, Wolfram MathWorld.
- Scaling based on Amazon SQS, AWS Auto Scaling User Guide.