[Varnish] #1859: Average Hitrate Reported by Varnishstat Inaccurate

Varnish varnish-bugs at varnish-cache.org
Tue Feb 23 18:52:04 CET 2016


#1859: Average Hitrate Reported by Varnishstat Inaccurate
---------------------------------+-------------------------
 Reporter:  batty                |       Type:  defect
   Status:  new                  |   Priority:  normal
Milestone:                       |  Component:  varnishstat
  Version:  4.1.1                |   Severity:  normal
 Keywords:  varnishtat hit rate  |
---------------------------------+-------------------------
 We're in the process of upgrading from varnish 3.0.3 to varnish 4.1.1.
 During the upgrade it was noticed that the average hit rate reported by
 varnishstat in 4.1.1 does not match the hit rate calculated from the
 individual hit/miss metrics.  We have two servers running, one still on
 version 3.0.3 and one updated to version 4.1.1.  I restarted both servers
 at roughly the same time and immediately began running varnishstat each.

 The average hit rate according to varnish 4.1.1 is:  0.2465   0.3085
 0.3127[[br]]
 The average hit rate according to varnish 3.0.3 is:  0.6592   0.6402
 0.6182

 Here is a varnishstat -1 dump from each server:[[br]]
 varnishstat -1 4.1.1: http://pastebin.com/tP5AE995 [[br]]
 varnishstat -1 3.0.3: http://pastebin.com/cg51CuUS

 Relevant metrics from 4.1.1:
 {{{
 MAIN.cache_hit             47970        20.23 Cache hits
 MAIN.cache_miss            22402         9.45 Cache misses
 }}}

 Relevant metrics from 3.0.3:
 {{{
 cache_hit                46306        19.81 Cache hits
 cache_miss               23223         9.94 Cache misse
 }}}

 From what I understand hit rate is calculated as cache_hit / (cache_hit +
 cache_miss) so...

 For varnish 4.1.1:[[br]]
 47970 / (47970 + 22402) = .6816

 For varnish 3.0.3:[[br]]
 46306 / (46306 + 23223) = .6659

 Both of these calculations correspond roughly to the average hit rate
 being reported by varnishstat in 3.0.3, however varnish 4.1.1 is reporting
 the much lower (0.2465   0.3085   0.3127).

 Is the hit rate being reported by varnishtat calculated differently in
 4.1.1?  I reported this the IRC channel and it was suggested I file a
 ticket.

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1859>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator



More information about the varnish-bugs mailing list