queueing-and-utilization
Installation
SKILL.md
Queueing and utilization
Two formulas answer most capacity questions.
Little's Law
L = λW, concurrency = arrival rate x time in system
It holds for any stable system regardless of arrival distribution, service distribution, or scheduling order. That generality is what makes it useful.
| Question | Formula | Example |
|---|---|---|
| Pool size | L = λW | 500 req/s x 40ms = 20 concurrent, not 200 |
| Latency from queue depth | W = L/λ | 3,000 messages draining at 100/s = 30s behind |
| Max throughput | λ = L/W | 20 connections at 40ms = 500 q/s ceiling |
| Time to drain | backlog / (rate - arrival) | 3,000 msgs, 100/s capacity, 60/s arriving = 75s |
Two habits worth building: