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
- Choose a synthetic pattern such as Zipf, a loop or a shifting hot set, or paste or drop your own log.
- Run the simulation and look at the hit ratio against cache size.
- Read the sizing answer for the hit ratio you want, and compare policies.
- Step through one policy to watch what it keeps and what it evicts.
Good to know
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.