Cache hit ratio calculator
Caching pays off nonlinearly: the last few percent of hit rate removes most of the remaining backend load.
%
ms
ms
Effective latency
11.440ms
- Requests reaching the backend
- 400.0 per second
- Speed-up against always missing
- 10.490
- Backend load removed
- 92.00 %
- Effective latency at a 99% hit rate
- 3.180 ms
- Backend load at a 99% hit rate
- 50.0 per second
Show the working
- Hit rate = 92
- Latency on a hit = 2
- Latency on a miss = 120
- Requests per second = 5000
- h = 92 / 100 = 0.92
- Effective latency = 0.92 * 2 + (1 - 0.92) * 120 = 11.44
- Requests reaching the backend = 5000 * (1 - 0.92) = 400
- Backend load removed = 92 = 92
- Speed-up against always missing = 11.44 > 0 ? 120 / 11.44 : 0 = 10.4895
- Effective latency at a 99% hit rate = 0.99 * 2 + 0.01 * 120 = 3.18
- Backend load at a 99% hit rate = 5000 * 0.01 = 50
Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.
Scenarios & local history
Compare a saved scenario
Recent calculations
The formula
- effective latency = hit rate x hit latency + miss rate x miss latency
Going from 90% to 99% hit rate cuts backend load by a further factor of ten, even though the hit rate only moved nine points.