Size a cache from the working set and the hit rate it should achieve.
Hit rate rises with cache size but with diminishing returns, because popular items are cached first. Caching the top tenth of items commonly delivers most of the achievable hit rate. Sizing a cache for the full working set is usually wasteful; the right size is where the hit rate curve flattens.
Cache Size
Cache size = working set × target hit rate × item size with metadata overhead
Cache size = working set × target hit rate × item size with metadata overhead Hit rate rises with cache size but with diminishing returns, because popular items are cached first. Caching the top tenth of items commonly delivers most of the achievable hit rate.
Sizing a cache for the full working set is usually wasteful; the right size is where the hit rate curve flattens.
This calculator takes 5 inputs: Unique items in the working set, Average item size, Target hit rate, Per-item metadata overhead, Memory available. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.