Work out cache size for hit ratio instantly with clear inputs, formula shown and shareable results.
Access patterns are typically Zipf distributed, so a small share of keys serves most requests. Under a Zipf exponent alpha, reaching hit ratio h needs roughly h^(1/alpha) of the key space, which for alpha near 1 means about 90 percent of keys for a 90 percent hit ratio but far fewer for a more skewed workload. Per-entry metadata of around 60 bytes is added because it dominates for small values.
Zipf cache sizing
keys needed ~ total keys x target^(1/alpha); size = keys x (value bytes + per-entry overhead)
It determines how concentrated the popularity is. At alpha 1.2 a few percent of keys serve most traffic; at alpha 0.5 popularity is nearly flat and caching helps far less.
Log key accesses for a period and plot the cumulative hit ratio against cache size. That empirical curve beats any analytical model.