Monitoring Varnish Cache

Configure the Server Density agent to monitor your Varnish cache to:

• Collect important metrics about your cache performance
• Identify overall server slowdowns caused by the cache

Monitored metrics

See at the bottom of this article.

Installing the Varnish plugin package

Install the Varnish plugin on Debian/Ubuntu:

sudo apt-get install sd-agent-varnish

Install the Varnish plugin on RHEL/CentOS:

sudo yum install sd-agent-varnish

If you are using Varnish 4.1+ you will need to add the sd-agent user to the Varnish group:

sudo usermod -G varnish -a sd-agent

Read more about agent plugins.

Configuring the agent to monitor Varnish

1. Configure /etc/sd-agent/conf.d/varnish.yaml

init_config:

instances:
# The full path to the varnishstat binary
- varnishstat: /usr/bin/varnishstat

2. Restart the agent

sudo /etc/init.d/sd-agent restart

Verifying the configuration
Execute info to verify the configuration with the following:

sudo /etc/init.d/sd-agent info 

If the agent has been configured correctly you’ll see an output such as:

varnish
-----
  - instance #0 [OK]
  - Collected 289 metrics

You can also view the metrics returned with the following command:

sudo -u sd-agent /usr/share/python/sd-agent/agent.py check varnish

Configuring graphs

Click the name of your server from the Devices list in your Server Density account then go to the Metrics tab. Click the + Graph button on the right then choose the Varnish Cache metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.

Varnish Metrics 

  • Fetch Zero
  • S Pass
  • Backend Conn
  • N Vbc
  • Fetch Chunked
  • N Ban Retire
  • N Wrk Max
  • N Vampireobject
  • N Vcl
  • Hcb Lock
  • N Vcl Avail
  • N Ban Add
  • Dir Dns Hit
  • S Fetch
  • Client Drop Late
  • N Objecthead
  • Fetch Bad
  • Backend Fail
  • S Pipe
  • Esi Warnings
  • Fetch Oldhttp
  • Backend Unhealthy
  • N Ban
  • N Ban Obj Test
  • N Vcl Discard
  • Backend Recycle
  • N Wrk Lqueue
  • Shm Flushes
  • Fetch 304
  • Backend Req
  • Hcb Insert
  • N Backend
  • N Gzip
  • Fetch 204
  • S Sess
  • Client Req
  • S Bodybytes
  • N Object
  • Cache Hitpass
  • Sess Closed
  • N Objwrite
  • Shm Records
  • N Wrk Create
  • Backend Toolate
  • Sms Nreq
  • Fetch Head
  • Accept Fail
  • Sess Linger
  • Fetch Length
  • Fetch Close
  • Vmods
  • Client Conn
  • N Wrk Queued
  • Losthdr
  • Fetch Eof
  • N Lru Nuked
  • Shm Cycles
  • Sess Herd
  • Sms Nobj
  • Dir Dns Lookups
  • Cache Hit
  • N Objoverflow
  • N Ban Re Test
  • Fetch Failed
  • N Lru Moved
  • Backend Reuse
  • Shm Cont
  • N Gunzip
  • N Wrk Failed
  • Uptime
  • Dir Dns Cache Full
  • N Sess
  • Sess Readahead
  • Shm Writes
  • Cache Miss
  • Esi Errors
  • N Objsendfile
  • S Req
  • Backend Retry
  • Sms Balloc
  • N Wrk Drop
  • Sess Pipeline
  • N Waitinglist
  • Client Drop
  • Sms Bfree
  • Hcb Nolock
  • N Wrk
  • Dir Dns Failed
  • Sms Nbytes
  • Backend Busy
  • N Ban Dups
  • N Objectcore
  • S Hdrbytes
  • N Sess Mem
  • Fetch 1Xx
  • N Expired
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.