Effective way of monitoring cache hit/miss ratio?

James Pearson james at ifixit.com
Thu Jun 27 01:39:44 CEST 2013

Excerpts from Stephen Wood's message of 2013-06-26 15:58:56 -0700:
> Can anyone provide some advice for monitoring the cache hit/miss ratio?
> The current way I'm doing it seems overly complicated. I'm running a script
> every minute that executes"varnishstat -f cache_hit,cache_miss -1" and
> stores the hits and misses as a delta. It stores it as a delta because I
> need the hit/miss ratio over a period of time and not since the beginning
> of the application starting.
> It's cumbersome and requires two data points. It's also inflexible in terms
> of hit/miss ratio over arbitrary periods of time.
> Has anyone else encountered this and can provide some advice?

We wrote a small script called pipe-to-graphite[0] and run it with the included
varnish.sh to send all of the stats from varnishstat into Graphite[1], a really
cool project that replaces rrdtool for data storage and also has a nifty
graph-based frontend.  Graphite has a wide variety of functions[2] for
processing data (nonNegativeDerivative is useful for things like Varnish's hit
stats), and also support json and plaintext output via its API, so it's not
terribly difficult to use it as a data-source for things like Nagios.

 - P

[0]: https://github.com/iFixit/pipe-to-graphite
[1]: http://graphite.readthedocs.org/
[2]: http://graphite.readthedocs.org/en/0.9.10/functions.html

More information about the varnish-misc mailing list