Little's Law
The fundamental relationship between queue length, arrival rate, and wait time.
Tiny Summary
Little's Law states: L = λ × W. The average number of items in a system equals the arrival rate multiplied by the average time each item spends in the system. Critical for capacity planning.
The Formula
L = λ × W
L = items in system
λ = arrival rate (per second)
W = time in system (seconds)
The Stability Condition
Critical: λ must be less than μ (service rate)
μ = 1/W (service rate)
If λ ≥ μ: Queue grows infinitely
If λ < μ: System is stable
Example:
- Service time W = 1 second → μ = 1 req/sec
- If λ = 2 req/sec → Queue explodes (unstable)
- If λ = 0.5 req/sec → Healthy system
Real Applications
API Rate Limiting: L = concurrent connections, λ = requests/sec, W = response time
Database Pools: Set pool size based on expected L from arrival and service rates
Load Balancing: Calculate queue depth, trigger autoscaling when L exceeds threshold
Utilization Thresholds
ρ = λ/μ (utilization)
< 70%: Healthy
70-85%: Monitor closely
> 85%: Danger zone
≥ 100%: Unstable (infinite queue)
Key Insight
Linear relationship: Double arrival rate OR double service time → double queue length. Use this to predict when your system will saturate and scale before it happens.
Use the simulation to experiment with different arrival rates and service times!