Back to sketch

SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 17

Design metrics collection from thousands of servers

Intermediate · 35 min · Observability

An infrastructure team runs 40,000 servers across six data centers, and machines come and go all day as services scale. Engineers want every host's CPU, memory, disk, network and a few hundred application counters in the central metrics store, and they want to know when a host has gone quiet.

Requirements

  • Collect system and application metrics from every host every 10 seconds.
  • Deliver them to an existing central metrics store through its batch ingest API.
  • Keep collecting through a network or collection-tier outage and deliver the data afterwards.
  • Show which expected hosts have stopped reporting.
  • Change what is collected (metrics, intervals) without redeploying the agent.

Constraints and assumptions

  • 40,000 hosts, about 500 series per host, one sample per series every 10 seconds.
  • The on-host agent must stay under 1% of one CPU core and 100 MB of memory.
  • Data should reach the metrics store within 30 seconds normally.
  • Outages of the collection tier or a data center link last up to 15 minutes, a few times a year.
  • About 10% of hosts are replaced every day by autoscaling and deploys.

Out of scope for the first sketch

How the metrics store indexes, rolls up and queries data · Alert rules and paging · Logs and traces

Draw your design

Rough math and notes

Done on paper? Compare with the worked approaches