Aspect ratio calculator / Cache Sizing Lab

Cache Sizing Lab

Paste an access log with one cache key per line, or generate a synthetic workload, and replay it through eight eviction policies. The chart shows hit ratio against cache size, with the theoretical best as a dashed line, so you can tell how many entries you need and whether a smarter policy is worth it.

Tool · 2026 · Aspect ratio calculator

Start with a synthetic pattern to see how the curves look, then try your own log. The tool is in English only. It has more room in full screen. Free to use.

What it is

Cache Sizing Lab answers one question: how many entries does this cache need? It replays a sequence of requests through several eviction policies at many cache sizes and plots the hit ratio, so you can see where adding memory stops paying off.

How to use it

  1. Choose a synthetic pattern such as Zipf, a loop or a shifting hot set, or paste or drop your own log.
  2. Run the simulation and look at the hit ratio against cache size.
  3. Read the sizing answer for the hit ratio you want, and compare policies.
  4. Step through one policy to watch what it keeps and what it evicts.

Good to know

A count-based model. Every entry counts as one slot, whatever its real size, and there are no expiry times. The result is best for comparing policies and for a first estimate of size.

Files and license

Your log is processed in your browser and is not uploaded or stored. The tool itself is provided to use on this page and is not offered for download or copying.

Questions

Is my log uploaded?

No. The simulation runs in your browser, in a background worker when your browser supports one. Your data stays in this tab.

What format should the log have?

One cache key per line, such as a URL, user ID, object ID or block number. CSV and TSV files work too: pick the column and say whether the first row is a header.

Which policies are simulated?

FIFO, LRU, LFU, CLOCK, SIEVE, S3-FIFO and Random, plus Belady OPT, which knows the future and shows the best any policy could do.

How realistic is the simulation?

It is a simplified, textbook version. Capacity is a count of entries, every entry has size 1, and there are no expiry times or admission filters. Real caches add object sizes, expiry, and costs, so treat the result as a guide to sizing, not a promise.

How do I read the answer?

Find the hit ratio you want on the chart and read off the cache size where each policy reaches it. If the policies bunch close to OPT, a smarter policy will not help much, and if they are far apart, it might.

Can I save the result?

Yes. You can download the hit-ratio curve data as a CSV file.

Related tools and guides