Metrictank startup

January 21, 2020 ยท View on GitHub

The full startup procedure has many details, but here we cover the main steps if they affect:

  • performance/resource usage characteristics
  • cluster status
  • API availability
  • diagnostics
PhaseDescriptioneffect on CPU / RAM
load configload/validate configno
setup diagnosticsset up logging, profiling, proftriggerno
log startuplogs "Metrictank starting" messageno
start sending statsstarts connecting and writing to graphite endpointno
create Storecreate keyspace, tables, write queues, etcminor RAM increase ~ queue size
create Input(s)open connections (kafka) or listening sockets (carbon)no
start clusterstarts gossip, joins clusterno
create Indexcreates instance and starts write queuesminor RAM increase ~ queue size
start API serveropens listening socket and starts handling requests in not-ready modeno
init Indexcreates session, keyspace, tables, write queues, etc and loads in-memory index from persisted datareasonable RAM and CPU increase
create cluster notifieroptional: connects to Kafka, starts backfilling persistence message and waits until done or timeoutif backfilling: above-normal CPU, normal RAM usage
start input plugin(s)starts backfill (kafka) or listening (carbon) and maintain priority based on input lagif backfilling: above-normal CPU and RAM usage
mark ready stateimmediately (primary) / after warmup (secondary) detailsno

We recommend provisioning a cluster such that it can backfill a 7 hour backlog in half on hour or less. This means:

  • The CPU increase during the kafka backfilling is very significant: typically a 14x cpu increase compared to normal usage.
  • The RAM usage during the input data backfilling is typically about 1.5x to 2x normal, though the cluster.gc-percent-not-ready setting lets you trade cpu for memory usage during startup.

Backfilling will go as fast as it can until it reaches a bottleneck (kafka brokers, cpu constraints, etc), so your numbers may vary.

This is true for v0.11.0, but may need revising later.