Chapter 85. The Ratio Trick
I’ve played the same evil genie trick in both the Oracle buffer cache hit ratio story, and the mpg story. And I can play it for any ratio you want, even throughput and response time! Here’s the trick.1 Any ratio (r) is the quotient of a numerator (n) and a denominator (d): r = n/d. You probably remember two ways to make a ratio’s value bigger:
-
You can make the numerator (n) bigger; or
-
You can make the denominator (d) smaller.
Option b is always a good move for higher-is-better metrics, because the denominator represents a cost that you want to reduce. In the Oracle story, the denominator was the number of attempts upon the buffer cache. Eliminating attempts reduces the amount of work that the machine has to do, which frees up resources and makes the system run better. In the mpg story, the denominator was the amount of fuel consumed. Of course, the less fuel you consume, the better.
Option a—making the numerator bigger—is a sneaky option. In a higher-is-better metric, the numerator represents the good thing that you want more of.…Except when you have all you want of your good thing, and you don’t need any more. In the Oracle story, we wanted more cache hits for a given attempt count. If making the cache bigger accomplishes that, then it’s a win for the system. But you don’t need a bunch of extra hits caused by the choose_a_hit_ratio program, putting an extra burden on the system just to pad the hit rate.
Likewise, in the mpg story, you didn’t ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access