Your Queue Is Backed Up — When Does It Actually Clear?
Running an async job queue means you'll eventually hit a traffic spike or a deploy-time pause that leaves a pile of unprocessed jobs behind. The obvious question is: if things keep running as they are right now, when does the queue actually clear? Getting that answer right takes more than dividing queue length by processing speed — new jobs keep arriving while you're draining the backlog, so that has to be part of the math too.
This calculator multiplies your worker count by each worker's processing speed to get total throughput, then subtracts the incoming rate to get the net drain rate. If that net rate is positive, dividing queue length by it gives you the drain time. If the incoming rate is equal to or higher than your total throughput, though, the queue never shrinks — it just keeps growing, and the only real fix is adding more workers or speeding up per-task processing.
In production, incoming rate fluctuates by time of day, so averaging over the last few minutes gives a steadier estimate than reacting to a single spike. Also keep in mind that adding workers doesn't always scale throughput proportionally — if there's a bottleneck in a shared resource like a database connection pool or a rate-limited external API, more workers won't help as much as you'd expect.
Frequently Asked Questions
If your workers' combined processing speed is slower than the rate new tasks arrive, the queue only grows and never drains.
Usually, but if there's a bottleneck in a shared resource like a database connection pool or an external API, throughput won't scale proportionally with worker count.
Averaging the incoming rate over the last few minutes gives a stable estimate that isn't thrown off by momentary spikes.