InfyCalculator
💻

Cache Hit Ratio Calculator

Compute cache hit and miss ratios from your hit and miss counts, plus the effective average access time when hits and misses have different latencies.

Cache hits
Cache misses
Hit latency
Miss latency
Loading calculator…

How it works

Hit ratio = hits ÷ (hits + misses) · Effective time = hit ratio × hit latency + miss ratio × miss latency

The hit ratio is the share of requests served from cache, and it drives the whole point of caching. Because a miss is often tens of times slower than a hit, the average access time is a weighted blend of the two — dominated by misses even when they are rare. That is why small hit-ratio gains at the top end (say 95% to 99%) can cut average latency dramatically: you are eliminating the expensive misses that were carrying most of the total time.

Worked example

With 900 hits and 100 misses, the hit ratio is 900 ÷ 1000 = 90%. If a hit costs 1 ms and a miss 50 ms, effective time = 0.90 × 1 + 0.10 × 50 = 0.9 + 5 = 5.9 ms — so the 10% of misses account for 5 ms of the 5.9 ms average.

Frequently asked questions

What is a good cache hit ratio?

It depends on the workload, but CDNs and read-heavy caches often aim for 90%+ and content caches for 95–99%. What matters is the effect on effective latency and origin load; even a 70% ratio is valuable if misses are cheap and hits are frequent.

Why does effective time stay high at a good hit ratio?

Because misses are so much slower, they dominate the average. At 90% hits with a 50× miss penalty, misses still contribute the majority of the average time — which is why pushing the hit ratio those last few points pays off so much.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.