cacheMon

Caching systems research

Cache eviction can be simple.

We study how caches should decide what to keep. The answer keeps coming back simpler than the textbooks suggest: our two flagship algorithms, S3-FIFO and SIEVE, are built from plain FIFO queues, beat LRU on both miss ratio and throughput, and take under 20 lines of code to adopt. They now ship inside TiDB, Ceph, Cloudflare’s proxy, DragonflyDB, RisingWave and dozens of cache libraries.

Alongside the algorithms we maintain the tools the field runs on: the libCacheSim simulator and the largest open collection of production cache traces.

S3-FIFO, running. New objects land in the small queue. Most are never requested again — they are demoted quickly to the ghost queue, which keeps metadata only. The few that are reused graduate to the main queue. Three FIFO queues, no locks, no list reordering on a hit. Illustrative animation.
Adopted in
60+
open-source libraries, across 18 languages
Open traces
5,231
from 12 production datasets
Requests released
262B
24.5 PB of traffic, free to use
Simulator throughput
20M/s
requests per second on a realistic trace replay
To adopt SIEVE
<20
lines of code on average, across 5 libraries

The idea underneath all of it

HotOS ’23

LRU spends its effort in the wrong place. We argued at HotOS ’23, in FIFO can be Better than LRU, that two cheap primitives recover — and beat — its hit ratio without any of the bookkeeping. Every algorithm below is an application of one or both.

Lazy promotion
Do almost nothing on a cache hit. Promote an object only when it is about to be evicted, so the hot path stays lock-free and cache-friendly.
Quick demotion
Most objects in a real workload are requested exactly once. Get them out fast instead of letting them occupy the cache while they age.

Neither is free, and no algorithm wins on every axis — which is the whole reason we are called cacheMon.

S3-FIFO

SOSP ’23 3 static FIFO queues

A small queue absorbs new objects, a ghost queue remembers the ones that washed out, and a main queue holds what proved itself. No object is ever moved on a hit, which is what makes it scale — and being FIFO-only means writes stay sequential, so it suits flash too.

  • Up to 72% lower miss ratio than LRU — as published on s3fifo.com
  • 46% smaller cache and 6× the throughput of LRU — at a 10% target miss ratio, 16 threads
  • Evaluated on 6,594 traces across 14 datasets — lower miss ratio than state-of-the-art algorithms across them

Juncheng Yang, Yazhuo Zhang, Ziyue Qiu, Yao Yue, K. V. Rashmi.

SIEVE

NSDI ’24 Community Award

Genuinely simpler than LRU: one queue, one pointer, one bit per object. A hit just sets the bit — nothing moves. A “hand” walks from the tail towards the head looking for the first object whose bit is clear, and evicts it. That is the whole algorithm, which is why it drops into an existing LRU implementation without changing its data structures, and why it works as a building block for more advanced ones.

  • Lower miss ratio than 9 state-of-the-art algorithms on >45% of 1,559 traces — the next best manages 15%
  • >2× the throughput of an optimized LRU at 16 threads — and 16% faster single-threaded
  • 12–21 lines to add to a production cache library — each port took about an hour

Yazhuo Zhang, Juncheng Yang, Yao Yue, Ymir Vigfusson, K. V. Rashmi. Read the ports for yourself — SIEVE dropped into groupcache (Go, 21 lines), mnemonist (JavaScript, 12), lru-rs (Rust, 16) and lru-dict (Python + C, 21).

Everyone relaxes LRU to escape lock contention, but nobody had said which relaxation to pick. We benchmark five of them — Probabilistic-LRU, Batch-LRU, Delay-LRU, FIFO-reinsertion and Random-LRU — on production traces, and introduce promotion efficiency: hits earned per promotion performed.

  • Delay-LRU and FIFO-reinsertion substantially improve promotion efficiency
  • Batch-LRU and Probabilistic-LRU cannot cut promotions without paying in miss ratio
  • Two new designs follow from that — Delayed FIFO-reinsertion and Age-Guided Eviction — with 20–60% fewer promotions — at a similar or lower miss ratio

Qinghan Chen, Muhammad Haekal Muhyidin Al-Araby, Ziyue Qiu, Zhuofan Chen, Rashmi Vinayak, Juncheng Yang.

Clock2Q+

VLDB ’26 In VMware vSAN

Metadata caches have a problem the algorithms above do not solve: a single logical operation can touch the same block several times in a row, and every policy that counts references mistakes that burst for a hot block. Clock2Q+ keeps three queues and a reference bit, and adds one idea — a correlation window at the head of the small queue, inside which a reference does not set the bit. Blocks have to earn their promotion after the correlated burst has passed, and unlike 2Q or CART, identifying them costs no extra misses.

  • Up to 28.5% lower miss ratio than S3-FIFO on metadata traces — S3-FIFO being the next best
  • Also lower on ordinary data workloads — which do not show the correlated pattern it targets
  • Shipping in VMware vSAN and VDFS — two flagship storage products at VMware by Broadcom

Yiyan Zhai, Bintang Dwi Marthen, Sarath Balivada, Vamsi Sudhakar Bojji, Eric Knauft, Jitender Rohilla, Jiaqi Zuo, Quanxing Liu, Maxime Austruy, Wenguang Wang, Juncheng Yang.

S4-FIFO

OSDI ’26 Learning-augmented heuristics

Learned caches usually put a model on the data path and pay for it on every request. S4-FIFO splits the two apart: a plain FIFO heuristic makes every admission and eviction decision, while an offline-trained gradient-boosted model periodically picks the best configuration from cache-level workload features. Because the model never sees an individual object, throughput stays at heuristic parity and the policy stays legible — it is five operational parameters, not a black box.

  • +26% mean efficiency over S3-FIFO and +8% over 3L-Cache — as reported in the artifact’s reproduction guide
  • Worst case costs 0.8% miss ratio against plain FIFO — where 3L-Cache costs 8.8%

Haocheng Xia, William Nixon, Bintang Dwi Marthen, Pranav Bhandari, Juncheng Yang.

libCacheSim

C / C++

A cache simulator, a trace analyzer and a library for building your own simulators. It replays traces at over 20 million requests per second with a small, predictable memory footprint, parallelizes across cores out of the box, and ships more than twenty eviction algorithms — FIFO, LRU, ARC, 2Q, LFU, LHD, LRB, TinyLFU, GL-Cache, Belady’s optimal, S3-FIFO and SIEVE among them — plus admission and prefetching policies.

  • 20M+ requests/sec on a realistic trace replay
  • The only feature-rich cache trace analyzer we know of
  • Add a new algorithm or trace format by implementing one interface

libcachesim for Python

pip install libcachesim

The same engine, driven from Python, for when an experiment should take an afternoon rather than a build cycle. It streams traces straight out of our S3 bucket, exposes individual requests and cache internals, and lets you prototype a brand-new eviction policy in pure Python with no compilation step.

5,231 traces from twelve production datasets — key-value, object and block caches contributed by Meta, Twitter, Google, Alibaba, Tencent, Microsoft, Wikimedia, IBM and CloudPhysics — converted into two common formats and hosted on S3 under CC BY 4.0. Read them directly from the bucket, or mount it on a cluster and compute in place.

Every dataset comes as plain text and in oracleGeneral format, which annotates each request with its next-access time so Belady’s optimal can be computed. Per-dataset figures are as reported in the dataset README; the total is their sum.
Dataset Type Year Traces Requests (M) Traffic (TB)
Twitter TwemcacheKey-value202054195,441106
Meta key-valueKey-value202251,644958
Tencent CBSBlock20204,03033,6901,091
Alibaba blockBlock20201,00019,676664
Tencent PhotoObject201825,650141
Wikimedia CDNObject201932,863200
CloudPhysicsBlock20151062,11482
Microsoft CambridgeBlock20071341010
Meta CDNObject202532318,800
Google synthetic I/OBlock2024311512,420
IBM Docker registryObject201873811
Meta TectonicBlock202351448
Total12 datasets5,231261,88624,531

Please cite the paper each trace was originally released with — the repository lists every BibTeX entry. Storage is donated by AWS under their open data programme.

S3-FIFO and SIEVE have been picked up by more than 60 open-source libraries and packages across 18 programming languages, plus the production systems below.

Systems running Clock2Q+

Cache libraries

Shipped one of our algorithms somewhere? Tell us — we would like to list you, and we would rather hear about the cases where it did not work out.

cacheMon is the open-source home of the caching work done by the Harvard MADSys Lab — Measurements and Design of Computer Systems, the group at Harvard SEAS led by Juncheng Yang, assistant professor of computer science. It spans eviction algorithms, cache workload analysis, simulation tooling and the datasets the field tests against.

Almost none of it is one lab’s work. The algorithms came out of a long collaboration with Carnegie Mellon’s Parallel Data Laboratory, where this line of research started; the traces and the hardware to run them on came from Meta, whose CacheLib team released the key-value, CDN and Tectonic datasets and whose engineers co-authored the flash work; and Clock2Q+ was built and shipped with VMware. Emory, ETH Zürich, UIUC and the Pelikan Foundation are on the author lists too.

Core team

Every paper in the publication list carries its full author list — this work has had a lot more hands on it than the thirteen named here.

The group’s underlying thesis — that cache management should get simpler and faster at the same time — was recognised with the 2025 ACM SIGOPS Dennis M. Ritchie Doctoral Dissertation Award for “Designing Efficient and Scalable Key-Value Cache Management Systems.”

We are glad to hear from people running caches in production, and from students who want to work on them. Bug reports, ports and negative results are all welcome.