[Varnish] #613: Efficiency figure for varnishstat
Varnish
varnish-bugs at projects.linpro.no
Wed Jan 6 23:36:44 CET 2010
#613: Efficiency figure for varnishstat
-------------------------+--------------------------------------------------
Reporter: slink | Owner: phk
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: varnishstat | Version: trunk
Severity: normal | Keywords:
-------------------------+--------------------------------------------------
In some deployment scenarios, the (cache) hit ratio of varnishstat
suggests that the cache was providing great benefit and really the cache
itself probably is, but still (too) many requests hit the backend in the
form of passes or even piped sessions.
I am suggesting to add an efficiency measure to varnishstat, defined as
the ratio of client requests minus backend requests by client requests.
efficiency = client requests - passes - pipes - fetches / client requests
While one could argue that cache hits by client requests would do as well,
at least as of now I believe that this measure is more accurate because it
also takes into account that one client request may trigger multiple
backend requests.
With the attached patch, varnishstat will look something like this
{{{
2+12:13:01
HOSTNAME
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
}}}
Two notes on the patch
* I've chosen to implement a macro rather than a function, but I'll be
happy to make this a function if core team members prefer
* One might want to exclude the additional "ratio" line because users may
find it redundant. And in fact it's probably not very likely that the two
sets of numbers will ever differ. At any rate, I think state for the
number of samples should be kept even if it's not printed.
--
Ticket URL: <http://varnish.projects.linpro.no/ticket/613>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list