Request hit ratio
Request hit ratio is the fraction of counted cache requests classified as hits at a stated cache boundary.
Count repeated eligible accesses, not distinct keys; specify the request types, observation window, warmup treatment and rule for partial hits. The familiar hits/(hits + misses) formula applies when those categories exhaust the counted requests. A request hit ratio weights accesses equally; a byte hit ratio weights payload bytes. [1]
For compatible, disjoint observations, divide summed hits by summed requests. An equally weighted average of window ratios describes an average window, not the pooled request population. An empty request population has an undefined ratio, not an observed zero-percent hit ratio. [2]
RocksDB distinguishes data, index and filter block-cache accesses. [3] The measurement implication is that block-level counters do not directly establish application-request or SSD mapping-cache hit ratios; those require their own observation boundaries.
A lower cache can observe a stream filtered by an upper cache. [5] For a two-level read-only hierarchy with exactly one lower lookup per upper miss, no prefetch, retries or splitting, the application-level hit fraction is h1 + (1 - h1) * h2; h2 is conditional on reaching the lower level. Summing all level-local request counters uses a different population. [4]
Improving an upper-level hit ratio need not reduce backend reads. For constructed ABCABDEA with independent demand LRU levels and four lower slots, growing the upper cache from two to three slots changes upper hits from 0/8 to 2/8, lower hits from 3/8 to 0/6, and backend reads from 5/8 to 6/8. The upper hits remove lower recency updates. This exact cold-start example excludes writes, prefetch and cross-level invalidation; it is not measured device performance. [6]
Relations
- related
- GreedyDual-Size, Byte hit ratio, Least Hit Density, Miss-ratio curve, Cache admission, SSD mapping cache, Multi-Queue cache replacement, AdaptSize, MIMIR, One-hit-wonder ratio, RobinHood caching
Limitations
- A hit ratio alone does not determine latency, backend bytes or NAND operations; record the measurement boundary and cost of misses. [1, 4]
Citations
- Einziger, Eytan, Friedman and Manes. Lightweight Robust Size Aware Cache Management. arXiv:2105.08770v2 (2021), section 1: request and byte hit ratios.
- Prometheus documentation. Recording rules: Aggregation; sum numerators and denominators separately before division.
- RocksDB project. Block Cache: Statistics; separate data, index and filter block hits and misses.
- Hesela. Pool counts before comparing hit ratios: illustrative arithmetic and measurement boundaries.
- Zhou, Philbin and Li. The Multi-Queue Replacement Algorithm for Second Level Buffer Caches. USENIX ATC 2001, pp. 91-104, sections 2.2 and 3.1.
- Hesela. Two independently managed LRU caches: exact constructed trace, contract, code and controls; not a device measurement.