Skip to main content
← PROBLEMS / SYSTEM-DESIGN
An end-to-end domain learning journey

1M+ Concurrent Timer
Wheel Scheduler.

Design a lock-minimal timeout scheduler for 1,000,000 concurrent connections with 200k cancels/sec.
Start the journey7 stages· Last modified Nov 22, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When nodes partition or reboot past retry windows, use doubly-linked timing-wheel buckets with DelayQueue-driven tick advancement to avoid idle polling.

TL;DR30-second simplified summary
▾

A naive min-heap saturates on 200k timer mutations/sec. Combining a hierarchical timing wheel with a DelayQueue over non-empty buckets avoids empty-tick CPU spinning while preserving O(1) insert and O(1) cancel.

Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
Hierarchical Timing Wheels
Schedule millions of concurrent timers in O(1) time using concentric circular bucket arrays and doubly-linked lists.
Full walkthrough · 7 stages
01
foundation

Stage 1: Core Mental Model.

Why this matters: Establish core mental model for 1M+ Concurrent Timer Wheel Scheduler.

Think of Stage 1: Core Mental Model as the intuition layer for 1M+ Concurrent Timer Wheel Scheduler: Establish core mental model for 1M+ Concurrent Timer Wheel Scheduler.

Stage 1: Core Mental Model establishes how 1M+ Concurrent Timer Wheel Scheduler behaves under real production load.

Component Topology

Stage 1: Core Mental Model

CalleringressRouter / APIcomputeProcessorstorageState Layercontrolrequestdispatchread/write
02
foundation

Stage 2: Production Failure Mode.

Why this matters: Establish production failure mode for 1M+ Concurrent Timer Wheel Scheduler.

Think of Stage 2: Production Failure Mode as the intuition layer for 1M+ Concurrent Timer Wheel Scheduler: Establish production failure mode for 1M+ Concurrent Timer Wheel Scheduler.

Stage 2: Production Failure Mode establishes how 1M+ Concurrent Timer Wheel Scheduler behaves under real production load.

Engineering Decision Framework
Problem
How to implement 1M+ Concurrent Timer Wheel Scheduler without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
When nodes partition or reboot past retry windows, use doubly-linked timing-wheel buckets with DelayQueue-driven tick advancement to avoid idle polling.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When 1M+ Concurrent Timer Wheel Scheduler experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
intermediate

Stage 3: Naive Min-Heap.

Why this matters: Establish naive min-heap for 1M+ Concurrent Timer Wheel Scheduler.

Think of Stage 3: Naive Min-Heap as the intuition layer for 1M+ Concurrent Timer Wheel Scheduler: Establish naive min-heap for 1M+ Concurrent Timer Wheel Scheduler.

Stage 3: Naive Min-Heap establishes how 1M+ Concurrent Timer Wheel Scheduler behaves under real production load.

Lifecycle & Failure Recovery

Stage 3: Naive Min-Heap

admitsucceedbudget exceededInitializedProcessingInvariant MetDegraded Fallback
04
intermediate

Stage 4: Hierarchical Wheel.

Why this matters: Establish hierarchical wheel for 1M+ Concurrent Timer Wheel Scheduler.

Think of Stage 4: Hierarchical Wheel as the intuition layer for 1M+ Concurrent Timer Wheel Scheduler: Establish hierarchical wheel for 1M+ Concurrent Timer Wheel Scheduler.

Stage 4: Hierarchical Wheel establishes how 1M+ Concurrent Timer Wheel Scheduler behaves under real production load.

05
intermediate

Stage 5: Reference Code & Cancel Safety.

Why this matters: Establish reference code & cancel safety for 1M+ Concurrent Timer Wheel Scheduler.

Think of Stage 5: Reference Code & Cancel Safety as the intuition layer for 1M+ Concurrent Timer Wheel Scheduler: Establish reference code & cancel safety for 1M+ Concurrent Timer Wheel Scheduler.

Stage 5: Reference Code & Cancel Safety establishes how 1M+ Concurrent Timer Wheel Scheduler behaves under real production load.

06
advanced

Stage 6: Complexity Bounds.

Why this matters: Establish complexity bounds for 1M+ Concurrent Timer Wheel Scheduler.

Think of Stage 6: Complexity Bounds as the intuition layer for 1M+ Concurrent Timer Wheel Scheduler: Establish complexity bounds for 1M+ Concurrent Timer Wheel Scheduler.

Stage 6: Complexity Bounds establishes how 1M+ Concurrent Timer Wheel Scheduler behaves under real production load.

Design Trade-Off

Stage 6: Complexity Bounds

Before · Unbounded Coupling
  • No backpressure on spikes
  • Implicit shared state
  • Cascading tail latency
After · Bounded & Observable
  • Explicit capacity budgets
  • Isolated failure domains
  • Predictable p99 latency
07
advanced

Stage 7: Operational Telemetry.

Why this matters: Establish operational telemetry for 1M+ Concurrent Timer Wheel Scheduler.

Think of Stage 7: Operational Telemetry as the intuition layer for 1M+ Concurrent Timer Wheel Scheduler: Establish operational telemetry for 1M+ Concurrent Timer Wheel Scheduler.

Stage 7: Operational Telemetry establishes how 1M+ Concurrent Timer Wheel Scheduler behaves under real production load.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

Why does 1M+ Concurrent Timer Wheel Scheduler beat a Min-Heap (Check 1)?

Recommended Learning Flow