Effective way of monitoring cache hit/miss ratio?
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 and run it with the included
varnish.sh to send all of the stats from varnishstat into Graphite, 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 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.
More information about the varnish-misc