Warm and Cold Data Access

A measurement can reuse cached data or wait for a lower-level source. State which data locality the workload represents.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace two lookups
  2. Avoid a cache-only workload by accident
  3. Match the cache layer to the measured effect
  4. Avoid introducing unrelated changes while resetting one layer

Trace two lookups

The first article request might read storage. A repeated request of the same version can use a cached representation. Service caches give the application-level example.

Avoid a cache-only workload by accident

If real traffic visits many distinct articles, repeatedly requesting one can overstate reuse. Choose an input distribution matching the question. See average cost and distribution.[1]

Match the cache layer to the measured effect

An initial file lookup can load pages into the OS cache. A second process may then read faster even with no application cache, because the system retains data. A benchmark should say what was reset before each run. See a second filesystem read.

Process cold + system data warm can still be fast
Process warm + new data can still require storage
Record application, process and dataset state separately

Avoid introducing unrelated changes while resetting one layer

Fully clearing caches can disrupt other workloads and does not always represent normal use. Use an isolated representative experiment. Include repeated reads and new inputs with the same sizes.

References

  1. Google, Site Reliability Engineering ↩