Skip to main content
QUICK REVIEW

[Paper Review] TinyLFU: A Highly Efficient Cache Admission Policy

Gil Einziger, Roy Friedman|arXiv (Cornell University)|Dec 2, 2015
Caching and Content DeliveryComputer Science58 references26 citations
TL;DR

This paper proposes TinyLFU, a space-efficient approximate frequency-based cache admission policy that uses a counting Bloom filter to estimate access frequencies with minimal metadata overhead. By integrating TinyLFU with any replacement policy—especially in the W-TinyLFU variant—it achieves state-of-the-art hit ratios across diverse real-world workloads, outperforming existing schemes on all tested traces while using only 0.8 bytes per entry.

ABSTRACT

This paper proposes to use a frequency based cache admission policy in order to boost the effectiveness of caches subject to skewed access distributions. Given a newly accessed item and an eviction candidate from the cache, our scheme decides, based on the recent access history, whether it is worth admitting the new item into the cache at the expense of the eviction candidate. Realizing this concept is enabled through a novel approximate LFU structure called TinyLFU, which maintains an approximate representation of the access frequency of a large sample of recently accessed items. TinyLFU is very compact and light-weight as it builds upon Bloom filter theory. We study the properties of TinyLFU through simulations of both synthetic workloads as well as multiple real traces from several sources. These simulations demonstrate the performance boost obtained by enhancing various replacement policies with the TinyLFU eviction policy. Also, a new combined replacement and eviction policy scheme nicknamed W-TinyLFU is presented. W-TinyLFU is demonstrated to obtain equal or better hit-ratios than other state of the art replacement policies on these traces. It is the only scheme to obtain such good results on all traces.

Motivation & Objective

  • To address the high memory and computational cost of exact LFU in real-world caching systems with dynamic access patterns.
  • To design a compact, scalable admission policy that approximates frequency-based caching without tracking all items in main memory.
  • To decouple admission from eviction policies, enabling independent optimization of each component.
  • To evaluate the effectiveness of TinyLFU and W-TinyLFU across synthetic and real-world workloads under varying cache sizes and access distributions.
  • To quantify the impact of approximation errors (false positives, truncation, sampling) on cache hit ratio in realistic settings.

Proposed method

  • TinyLFU uses a counting Bloom filter to maintain approximate access frequency counts for a large sample of recently accessed items, enabling low-memory frequency estimation.
  • The admission policy evaluates whether a new item should replace the current cache victim based on its estimated frequency relative to the victim’s frequency.
  • W-TinyLFU combines a main cache with a windowed cache (W) and uses TinyLFU to guide admission decisions, improving hit ratio by prioritizing frequently accessed items.
  • The system employs integer counters with truncation during reset operations to reduce memory footprint, with error analysis to assess impact on accuracy.
  • Approximation errors are analyzed via false positives in the counting Bloom filter, while sampling and truncation errors are measured under static Zipf distributions.
  • The implementation in Caffeine uses CM-Sketch with 8 bytes per entry (0.8 bytes per sample), and performance is tuned by adjusting sample size and counter precision.

Experimental results

Research questions

  • RQ1Can a lightweight, approximate frequency-based admission policy significantly improve cache hit ratios without incurring high metadata costs?
  • RQ2How does the integration of TinyLFU with existing replacement policies affect performance across diverse workloads?
  • RQ3What is the trade-off between memory efficiency and accuracy in frequency estimation for cache admission?
  • RQ4How do false positives, truncation, and sampling errors collectively impact the hit ratio of TinyLFU in real-world traces?
  • RQ5Can W-TinyLFU consistently outperform state-of-the-art replacement policies across multiple real-world and synthetic workloads?

Key findings

  • W-TinyLFU achieves equal or better hit ratios than all other state-of-the-art replacement policies across all tested real-world traces (OLTP, F1, F2).
  • The hit ratio of W-TinyLFU is maximized with window cache sizes of 20–40% of the main cache size on the OLTP, F1, and F2 traces.
  • The approximation error in TinyLFU—due to false positives in the counting Bloom filter—only becomes significant beyond approximately 1.25 bytes per sample item, with negligible impact below that threshold.
  • The truncation error is more pronounced in smaller samples (e.g., 9k items) and becomes negligible in larger samples (e.g., 17k items), especially with higher counter precision.
  • Increasing metadata allocation from 8 to 16 bytes per entry in Caffeine improves hit ratio by approximately 0.5%, indicating a 0.5% approximation error in the default configuration.
  • TinyLFU’s design decouples admission from eviction, enabling modular optimization and demonstrating that admission policy can significantly boost performance even with minimal metadata overhead.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.