Design a Cluster Health Monitoring
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.
- 1How big is the cluster?
- 2How fast must we detect a dead host?
- 3How many metrics?
- 4How long is data kept?
- 5Push or pull?
- 6Who gets alerts?
- 7Logs and traces too?
- 8Does monitoring fix things automatically?
How to spend the 45 minutes
- 5minPart 1: Requirements and scope
- 5minPart 2: Estimates
- 5minPart 3: API and data model
- 15minPart 4: Architecture, stage by stage
- 15minPart 5: Failure detection, alerting and the watcher