Skip to main content
← CONCEPTS / DISTRIBUTED-SYSTEMS
An end-to-end domain learning journey

Hierarchical Timing
Wheels.

Schedule millions of concurrent timers in O(1) time using concentric circular bucket arrays and doubly-linked lists.
Start the journey7 sections· Last modified Nov 22, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

Schedule millions of concurrent timers in O(1) time using concentric circular bucket arrays and doubly-linked lists.

TL;DR30-second simplified summary
▾

In high-concurrency servers and message brokers, 99% of connection and RPC timeouts are cancelled before expiring. Hierarchical Timing Wheels replace O(log N) heaps with stacked circular arrays of doubly-linked bucket lists, cascading coarse outer buckets into finer inner wheels in amortized O(1) time.

From patterns to decisions.

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.

02
foundation

Stage 2: Production Failure Mode.

03
intermediate

Stage 3: Naive Min-Heap.

04
intermediate

Stage 4: Hierarchical Wheel.

05
intermediate

Stage 5: Reference Code & Cancel Safety.

06
advanced

Stage 6: Complexity Bounds.

07
advanced

Stage 7: Operational Telemetry.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

Why does Hierarchical Timing Wheels beat a Min-Heap (Check 1)?

Recommended Learning Flow