SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 39
Design health monitoring for a large cluster
A platform team runs 10,000 machines in three data centers. When a machine dies or starts misbehaving, the job scheduler and load balancers need to stop sending it work, and the on-call engineer needs to hear about real problems. Last quarter a single switch failure sent 400 pages in five minutes, and nobody wants that again.
Requirements
- Detect machines that have crashed, hung or become unreachable, and machines that are up but degraded (failing disk, very slow responses).
- Publish each machine's current health state so schedulers and load balancers can read it.
- Evaluate alert rules, group related alerts into one incident, and notify on-call; support silences during planned maintenance.
- Keep working when part of the cluster, the network, or part of the monitoring system itself fails.
Constraints and assumptions
- 10,000 machines, roughly 40 per rack, 250 racks across 3 data centers.
- A dead machine must be marked unhealthy within 30 seconds.
- At most one or two false "dead" verdicts per day across the fleet; machines can pause for several seconds during garbage collection or heavy I/O.
- Schedulers read health state about 1,000 times per second.
- One page per incident: a rack or data-center failure should not produce a page per machine.
Out of scope for the first sketch
Long-term metrics storage and dashboards · On-call rotations and escalation policies · Automatic repair beyond marking a machine unhealthy
Draw your design
Rough math and notes
SYSTEM DESIGN SKETCHBOOK / FOLLOW-UPS
Design health monitoring for a large cluster
Finish your first sketch before answering these. Cross out freely.
- How do you choose the heartbeat interval and the timeout, and why does a fixed timeout cause false alarms here?
- A top-of-rack switch fails and 40 machines vanish at once. How many pages does on-call get, and what makes that happen?
- The monitoring service in one data center loses its network link to the other two. How do you avoid declaring two-thirds of the fleet dead?
- A machine keeps sending heartbeats, but its disk is failing and requests to it time out. How does your design notice?
- Who monitors the monitoring system, and how do you find out if it has silently stopped working?
Compare afterwards: worked approaches and reading at sketchbook /questions/cluster-health-monitoring/review