Warm-Up and Cold Start in Measurements

Initial work can involve loading data or preparing execution. Later operations can reuse that work, changing what a benchmark measures.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a service start
  2. Measure the intended scenario
  3. Label when initialization happens
  4. Keep paid-once and per-request costs in the workload

Trace a service start

A first request may open a dependency and load an index. The next one can reuse both. Reusing a connection illustrates a specific startup contribution.

Measure the intended scenario

A cold launch benchmark should include required initialization. A sustained workload can measure the warmed state after identifying the warm-up period. See filesystem reads and caching.[1]

Label when initialization happens

A program spends one hundred milliseconds importing modules and building a lookup table. Each later lookup takes two milliseconds. A one-shot command can pay about 102 milliseconds, while a long-lived service can make many lookups after initialization. See separating setup and query work.

First useful response: init 100 + query 2 = 102 ms
Later response: about 2 ms in this model
Measure each under a repeatable start condition

Keep paid-once and per-request costs in the workload

Restarting the process may still leave storage or system caches warm. Define what cold means and check whether the warm condition has stabilized. Record outcomes during startup transitions.

References

  1. Google, Site Reliability Engineering ↩