Has anyone developed, or does anyone know of, any third-party tools (or non-obvious uses of the stock tools) to help a poor systems administrator determine what's going on with requests that are passing through Varnish? While varnishstat, varnishtop, and varnishhist give me either very high-level (or low-level) overviews, I'm looking for something that tells me things like:

  • What requests are currently in progress (and how long they've been like that, where they got sent, that sort of thing)
  • Average service times for requests by backend, vhost, that sort of thing
  • Other things that will help me identify misbehaving backends, vhosts, etc.
link|improve this question

67% accept rate
feedback

2 Answers

up vote 3 down vote accepted

varnishncsa displays logs in Apache/NCSA combined log format (from man page). You can use these with any normal log analyzer to find which user agents you have, which pages they load etc.

varnishlog (usr/bin/varnishlog) on the other hand displays detailed output for all the requests, containing information like which VCL commands are being used (lookup, hash, hit, deliver etc.) and all headers in the HTTP transaction (varnishlog -o will group them by request). If you have a busy site this will scroll through very quickly, but you can write them to disk using -w, or use the logger facility (etc/init.d/varnishlog). Be aware that this quickly fills up the disk, because it is very detailed (10-30 lines per request depending on where the requests get sent, and of course all your HTTP headers).

varnishreplay can replay the HTTP traffic from such a log file.

Most of the tools can be used with regex searching.

Redpill Linpro, the company making Varnish, are currently making a web gui. I'm not sure which features it will have (I don't think they quite know either), but I am assured that it will have quite a few monitoring graphs.

link|improve this answer
1  
And BTW, at least in Ubuntu, varnishncsa comes with associated configuration files: /etc/init.d/varnishncsa, /etc/logrotate.d/varnish, /etc/default/varnishncsa. All you need to do to start logging to /var/log/varnish/varnishncsa.log is uncomment ENABLE_VARNISHNCSA=1 in /etc/default/varnishncsa – PÄ“teris Caune Jan 3 '11 at 18:16
feedback
  • try varnishncsa to get per request logging
  • varnish top has avg service and hit times
  • IMHO, if you suspect problems with your backends you should be monitoring the directly, without going through varnish.
link|improve this answer
Anything "non-obvious" I should be doing with varnishncsa to get more useful logs? The default format isn't exactly rocking my socks. varnishtop does overall averages, but doesn't do anything to break them down. And yes, there's monitoring on the backends, but it would be far better if I could determine if my backend monitoring is missing something by asking varnish. – womble May 3 '09 at 3:48
You're probably going to have to write something custom. AFAIK all the varnish tools communicate via a shared memory area, check out the varnish-cache/bin tools to see how they interrogate with the main varnish process – Dave Cheney May 3 '09 at 4:43
feedback

Your Answer

 
or
required, but never shown

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