Skip to content
SD-39 · System design

Design a Cluster Health Monitoring

Asked at Senior level45 minutes
Our answers stay hidden until you reveal them.

Design a system that watches the health of a large cluster: about 100,000 machines in 5 data centers. It must notice within seconds when a machine dies or becomes unreachable, collect hundreds of metrics from every machine (CPU, memory, disk, network, service counters), show them on dashboards, evaluate alert rules, and page the right on-call engineer.

Every host sends about 500 metrics every 10 seconds, which is 5 million samples a second and 50 million live time series. The hard parts are telling a dead machine from a broken network path to it, so a flaky switch does not page thousands of times; taking 5 million samples a second without the storage falling over; turning one real failure into one useful page; and making sure that if the monitoring system itself fails, someone finds out.

Good questions to ask first

Decide what you would assume for each before you look at ours.

  1. 1How big is the cluster?
  2. 2How fast must we detect a dead host?
  3. 3How many metrics?
  4. 4How long is data kept?
  5. 5Push or pull?
  6. 6Who gets alerts?
  7. 7Logs and traces too?
  8. 8Does monitoring fix things automatically?

How to spend the 45 minutes

  1. 5minPart 1: Requirements and scope
  2. 5minPart 2: Estimates
  3. 5minPart 3: API and data model
  4. 15minPart 4: Architecture, stage by stage
  5. 15minPart 5: Failure detection, alerting and the watcher
Sketch your own design: boxes, arrows and the numbers that matter. Then compare it with ours.Break it in the labVisual walkthrough