I'm currently reading the second edition of Systems Performance by Brendan Gregg and had a question on the section about caching in Chapter 2. This section defines cache hit ratio as
hit ratio = hits / (hits + misses)
It goes on to say that the relationship between cache hit ratio and "performance" (for some hypothetical measure of system performance) is nonlinear. Specifically,
The performance difference between 98% and 99% is much greater than that between 10% and 11%. This is a nonlinear profile because of the difference in speed between cache hits and misses - the two storage tiers at play. The greater the difference, the steeper the slope becomes.
I don't quite understand where the nonlinearity in this relationship originates from. In order to explain this to myself, I concocted the following example. Consider the following, we model performance by some function f, where a lower value of f denotes better performance.
f(hit) = 10
f(miss) = 100
i.e. misses are 10x more expensive than hits. Assuming a hit ratio of 0, the "expected" performance of this system will be (0*10) + (1*100) = 100. A hit ratio of .01 (1% hits) yields (.01*10)+(.99*100) = 99.1. Finally a hit ratio of .02 (2% hits) yields (.02*10) + (.98*100) = 98.2. AFAICT, this is a linear relationship. What am I missing?
Thanks