How to calculate cache file usage (for Nagios monitoring) in varnish 3?

Dag Haavi Finstad daghf at varnish-software.com
Mon Feb 18 14:14:41 CET 2013


Hi

You can accomplish this by looking at SMF.s0.g_bytes and SMF.s0.g_space.

g_bytes is the amount of memory currently in use, g_space is what's
available. The sum of the two will equal the configured storage size.

To get "fill level" as a percentage, do g_bytes / (g_bytes + g_space).

Regards,
Dag



On Mon, Feb 18, 2013 at 1:30 PM, Sascha Ottolski <ottolski at web.de> wrote:

> Am Montag, 19. November 2012, 19:57:39 schrieben Sie:
> > Hi there,
> >
> > I'm wondering how I can monitor the actual usage of the cache "space".
> > Previous versions of the Nagios plugin had a "usage" parameter, that
> > would spit out a fill level as a percentage. Seems seems to have gone
> > away. I tried to roll my own by simply dividing
> >
> > SMF.s0.c_bytes (Bytes allocated) by SMF.s0.g_space (Bytes available)
> >
> > However, I misunderstood the semantics, the latter value does give me
> > the amount of free space, not the total size of the cache file.
> >
> > I could get the configured size from the config file
> >
> >     VARNISH_STORAGE_SIZE=512676693.9k
> >
> > or the commandline that is constructed from it
> >
> >     -s file,/var/cache/varnish/store.bin,512676693.9k
> >
> > but that feels a bit hacky to me. Any way to get that information from
> > the running instance?
> >
> > Thanks in advance for any pointers
> >
> > Sascha
>
> Please allow me to try again, I would expect that I'm not the only one
> wanting to monitor the cache usage ratio, am I?
>
> Cheers
>
> Sascha
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>



-- 
  <http://www.varnish-software.com>  *Dag Haavi Finstad*
Developer | Varnish Software AS
Phone: +47 21 98 92 60
We Make Websites Fly!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20130218/cf67af54/attachment.html>


More information about the varnish-misc mailing list