Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running an instance of Varnish with load-balancing to several backends. I want to get the statistics of the cache hits, cache misses, hit for pass for each backend and not the total if the server but varnishstat doesn't seem to have this information.

Do you guys know a way of getting this statistics?

share|improve this question
up vote 1 down vote accepted

Honestly, I'm not sure this makes sense. The backends don't store the cache data, Varnish does. Further, Varnish doesn't "select" a backend unless the cache misses. Taken together, this means that in a typical case, the number of cache misses for each of two backends, for example, is exactly half of the total. Now, I know you can get quite a bit fancier than this—for example, you might have different backends for administrative access modalities. However, that then simply makes this question a specific case of the general question, "Can I break down varnishstat output by (arbitrary distinction)?", the answer to which is, "No."

However, you can probably insert more data into varnishstat's output by using inline C in your VCL to directly modify the buffer from which varnishstat reads; never tried it, mind you, but seems like it should work. Failing that, you can always use the inline C to update your very own buffer (even an external one, e.g. memcache) and then write your own query program for it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.