Time to replace the hit ratio with something more intuitive?

Nils Goroll slink at schokola.de
Tue Jan 19 21:09:44 CET 2010


in http://varnish.projects.linpro.no/ticket/613 I have suggested to add a 
measure to varnishstat which I thought could be called the "efficiency ratio".

Tollef has commented that we'd need the community's (YOUR) opinion on this:

The varnishstat cache hit rate basically gives a ratio for how many requests 
being directed to the cache component of varnish have been answered from it. It 
does not say anything about the number of requests being passed onto the backend 
for whatever reason. So it is possible to see cache hit rates of 0.9999 (99.99%) 
but still 99% of the client requests hit your backend, if only 1% of the 
requests qualify for being served from the cache.

I am suggesting to amend (or replace ?) this figure by a ratio of client 
requests being handled by the cache by total number of requests. In other words, 
a measure for how many of the client requests do not result in a backend request.

My experience is that this figure is far more important, because cache users 
will mostly be interested in saving backend requests. The cache hit rate is 
probably of secondary importance, and it can be confusing to get a high cache 
hit rate while still (too) many requests are hitting the backend.

Here's how the two figures look like on a production system:

    Hitrate ratio:          10      100     1000
    Hitrate avg:        0.9721   0.9721   0.9731
Efficiency ratio:          10      100     1000
Efficiency avg:        0.9505   0.9522   0.9533

     55697963       200.97       256.93 Client connections accepted
    402992210      1518.81      1858.98 Client requests received
    390022582      1471.82      1799.15 Cache hits
         1549         0.00         0.01 Cache hits for pass
      9053637        22.00        41.76 Cache misses

Now it's up to you, what do you think about this?


More information about the varnish-misc mailing list