7

Using varnish-cache, I am running varnishtop -c -i RxURL to show number of client requests from the cache. The output looks somewhat like this:

list length 40                                                                                                                                                    

   121.76 RxURL          /some/path/to/file
   105.17 RxURL          /some/other/file
    42.91 RxURL          /and/another
    14.61 RxURL          /yet/another
    14.59 RxURL          /etc
    13.63 RxURL          /etc/etc

What do the numbers 121.76, 105.17 etc. stand for?

They are increasing when first issuing varnishtop, but then they tend to stabilize, so I tend to believe the represent number of hits per specific timeframe. Is that so, and what is the timeframe?

This is not explained in the man page. Thank you for any assistance!

Edit: varnish version is 2.1

Shlomi Noach
  • 9,073
  • 1
  • 23
  • 20

2 Answers2

16

The varnishtop command shows the rolling aggregate count over 60 seconds. That means even if all traffic stops, it will take 60 seconds to average down on the display.

list length 40

Total number of items in the list since the screen can only show so many at a time.

121.76 RxURL /some/path/to/file

~121 requests received in the last 60 seconds for /some/path/to/file.

Some other interesting monitoring stats:

# most frequent cookies
varnishtop -i RxHeader -I Cookie

# continually updated list of frequent URLs
varnishtop -i RxURL

# most frequent UA strings
varnishtop -i RxHeader -C -I ^User-Agent

# frequent charset (Accept-Charset can be replaced with any other HTTP header)
varnishtop -i RxHeader -C -I '^Accept-Charset'

# Requests resulting in 404's
varnishlog -b -m "RxStatus:404"
aleemb
  • 31,265
  • 19
  • 98
  • 114
1

It's the average number of requests per 60 seconds. The manual does say it - but at the parameter explanation rather than the general description of the tool:

-p period Specifies the number of seconds to measure over, the default is 60 seconds. The first number in the list is the average number of requests seen over this time period.

Clarence
  • 2,944
  • 18
  • 16
  • Thanks, but this is from the documentation of varnish `3.0`, not `2.1`. In fact, `-p` is not recognized in `2.1`. Nor is there any similar notion of "period" in the `2.1` docs. – Shlomi Noach Nov 07 '12 at 09:42
  • I should also note the numbers above are impossible for `60` seconds; way too high for the specific workload I was checking against (well, the numbers above are sample only; my real numbers aggregated over time are impossible for 60 seconds). – Shlomi Noach Nov 07 '12 at 09:42
  • Ohh, got me there ... but still seems odd they changed the behaviour of it. You could try a varnishlog during 60s and then process that information to make sure you're not missing something. – Clarence Nov 07 '12 at 19:44
  • Thanks; that's what I'm doing, and I can't get a reasonable match between numbers in `varnishlog` and those in `varnishtop`. Not for 60 seconds, not for `ttl`... – Shlomi Noach Nov 08 '12 at 07:08