Optimizing Cache Performance on Posterous
technology.posterous.com
technology.posterous.com
Not so fast. While the miss rate determines how much you need to regenerate, the miss time can have a huge effect on the average access time, which is what your users see.
If a is the average access time and m is the miss time (both in units of hit time), the required hit rate is (m-a)/(m-1). For largish m and reasonable a, the required hit rate can be quite high. (Memcache can be very fast relative to query+render.)
Things are more complicated when people are involved because people don't task-switch while waiting, they wander off. For example, you might want to cache so frequently accessed things have a higher miss rate. Why? Because the occasional long-access time on something that you do frequently can be seen as a glitch while a long-access time on something that you're doing for the first time (or rarely) looks like a broken system.
(Doesn't allow for simulation of course)
1. Your cache server is shared between several different classes of objects. In this case, the overall memcache hit/miss ratios might mask issues occurring in one class of cached values.
2. You want to figure out how your cache will improve with a given change in cache size (i.e., simulate results ahead of time, as you mentioned).