Monitoring Varnish

This article will help you get the Varnish plugin for sd-agent configured and returning metrics

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

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

or

sudo systemctl restart sd-agent

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

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

or

/usr/share/python/sd-agent/agent.py info

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

varnish
-----
  - instance #0 [OK]
  - Collected * 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 metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.

Screen_Shot_2018-01-18_at_11.46.12.png

Monitored metrics

Metric Values
varnish.LCK.backend.colls

Collisions.
lock / second
Type: float
varnish.LCK.backend.creat

Created locks.
lock / second
Type: float
varnish.LCK.backend.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.backend.locks

Lock operations.
lock / second
Type: float
varnish.LCK.ban.colls

Collisions.
lock / second
Type: float
varnish.LCK.ban.creat

Created locks.
lock / second
Type: float
varnish.LCK.ban.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.ban.locks

Lock operations.
lock / second
Type: float
varnish.LCK.busyobj.creat

Created locks.
lock / second
Type: float
varnish.LCK.busyobj.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.busyobj.locks

Lock operations.
lock / second
Type: float
varnish.LCK.cli.colls

Collisions.
lock / second
Type: float
varnish.LCK.cli.creat

Created locks.
lock / second
Type: float
varnish.LCK.cli.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.cli.locks

Lock operations.
lock / second
Type: float
varnish.LCK.exp.colls

Collisions.
lock / second
Type: float
varnish.LCK.exp.creat

Created locks.
lock / second
Type: float
varnish.LCK.exp.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.exp.locks

Lock operations.
lock / second
Type: float
varnish.LCK.hcb.colls

Collisions.
lock / second
Type: float
varnish.LCK.hcb.creat

Created locks.
lock / second
Type: float
varnish.LCK.hcb.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.hcb.locks

Lock operations.
lock / second
Type: float
varnish.LCK.hcl.colls

Collisions.
lock / second
Type: float
varnish.LCK.hcl.creat

Created locks.
lock / second
Type: float
varnish.LCK.hcl.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.hcl.locks

Lock operations.
lock / second
Type: float
varnish.LCK.herder.colls

Collisions.
lock / second
Type: float
varnish.LCK.herder.creat

Created locks.
lock / second
Type: float
varnish.LCK.herder.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.herder.locks

Lock operations.
lock / second
Type: float
varnish.LCK.hsl.colls

Collisions.
lock / second
Type: float
varnish.LCK.hsl.creat

Created locks.
lock / second
Type: float
varnish.LCK.hsl.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.hsl.locks

Lock operations.
lock / second
Type: float
varnish.LCK.lru.colls

Collisions.
lock / second
Type: float
varnish.LCK.lru.creat

Created locks.
lock / second
Type: float
varnish.LCK.lru.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.lru.locks

Lock operations.
lock / second
Type: float
varnish.LCK.mempool.creat

Created locks.
lock / second
Type: float
varnish.LCK.mempool.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.mempool.locks

Lock operations.
lock / second
Type: float
varnish.LCK.nbusyobj.creat

Created locks.
lock / second
Type: float
varnish.LCK.nbusyobj.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.nbusyobj.locks

Lock operations.
lock / second
Type: float
varnish.LCK.objhdr.colls

Collisions.
lock / second
Type: float
varnish.LCK.objhdr.creat

Created locks.
lock / second
Type: float
varnish.LCK.objhdr.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.objhdr.locks

Lock operations.
lock / second
Type: float
varnish.LCK.pipestat.creat

Created locks.
lock / second
Type: float
varnish.LCK.pipestat.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.pipestat.locks

Lock operations.
lock / second
Type: float
varnish.LCK.sess.creat

Created locks.
lock / second
Type: float
varnish.LCK.sess.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.sess.locks

Lock operations.
lock / second
Type: float
varnish.LCK.sessmem.colls

Collisions.
lock / second
Type: float
varnish.LCK.sessmem.creat

Created locks.
lock / second
Type: float
varnish.LCK.sessmem.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.sessmem.locks

Lock operations.
lock / second
Type: float
varnish.LCK.sma.colls

Collisions.
lock / second
Type: float
varnish.LCK.sma.creat

Created locks.
lock / second
Type: float
varnish.LCK.sma.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.sma.locks

Lock operations.
lock / second
Type: float
varnish.LCK.smf.colls

Collisions.
lock / second
Type: float
varnish.LCK.smf.creat

Created locks.
lock / second
Type: float
varnish.LCK.smf.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.smf.locks

Lock operations.
lock / second
Type: float
varnish.LCK.smp.colls

Collisions.
lock / second
Type: float
varnish.LCK.smp.creat

Created locks.
lock / second
Type: float
varnish.LCK.smp.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.smp.locks

Lock operations.
lock / second
Type: float
varnish.LCK.sms.colls

Collisions.
lock / second
Type: float
varnish.LCK.sms.creat

Created locks.
lock / second
Type: float
varnish.LCK.sms.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.sms.locks

Lock operations.
lock / second
Type: float
varnish.LCK.stat.colls

Collisions.
lock / second
Type: float
varnish.LCK.stat.creat

Created locks.
lock / second
Type: float
varnish.LCK.stat.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.stat.locks

Lock operations.
lock / second
Type: float
varnish.LCK.vbe.colls

Collisions.
lock / second
Type: float
varnish.LCK.vbe.creat

Created locks.
lock / second
Type: float
varnish.LCK.vbe.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.vbe.locks

Lock operations.
lock / second
Type: float
varnish.LCK.vbp.colls

Collisions.
lock / second
Type: float
varnish.LCK.vbp.creat

Created locks.
lock / second
Type: float
varnish.LCK.vbp.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.vbp.locks

Lock operations.
lock / second
Type: float
varnish.LCK.vcapace.creat

Created locks.
lock / second
Type: float
varnish.LCK.vcapace.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.vcapace.locks

Lock operations.
lock / second
Type: float
varnish.LCK.vcl.colls

Collisions.
lock / second
Type: float
varnish.LCK.vcl.creat

Created locks.
lock / second
Type: float
varnish.LCK.vcl.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.vcl.locks

Lock operations.
lock / second
Type: float
varnish.LCK.vxid.creat

Created locks.
lock / second
Type: float
varnish.LCK.vxid.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.vxid.locks

Lock operations.
lock / second
Type: float
varnish.LCK.wq.colls

Collisions.
lock / second
Type: float
varnish.LCK.wq.creat

Created locks.
lock / second
Type: float
varnish.LCK.wq.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.wq.locks

Lock operations.
lock / second
Type: float
varnish.LCK.wstat.colls

Collisions.
lock / second
Type: float
varnish.LCK.wstat.creat

Created locks.
lock / second
Type: float
varnish.LCK.wstat.destroy

Destroyed locks.
lock / second
Type: float
varnish.LCK.wstat.locks

Lock operations.
lock / second
Type: float
varnish.MEMPOOL.busyobj.allocs

Allocations.
event / second
Type: float
varnish.MEMPOOL.busyobj.frees

Frees.
event / second
Type: float
varnish.MEMPOOL.busyobj.live

In use.
None / None
Type: float
varnish.MEMPOOL.busyobj.pool

In pool.
None / None
Type: float
varnish.MEMPOOL.busyobj.randry

Pool ran dry.
event / second
Type: float
varnish.MEMPOOL.busyobj.recycle

Recycled from pool.
event / second
Type: float
varnish.MEMPOOL.busyobj.surplus

Too many for pool.
event / second
Type: float
varnish.MEMPOOL.busyobj.sz_needed

Size allocated.
byte / None
Type: float
varnish.MEMPOOL.busyobj.sz_wanted

Size requested.
byte / None
Type: float
varnish.MEMPOOL.busyobj.timeout

Timed out from pool.
event / second
Type: float
varnish.MEMPOOL.busyobj.toosmall

Too small to recycle.
event / second
Type: float
varnish.MEMPOOL.req0.allocs

Allocations.
event / second
Type: float
varnish.MEMPOOL.req0.frees

Frees.
event / second
Type: float
varnish.MEMPOOL.req0.live

In use.
None / None
Type: float
varnish.MEMPOOL.req0.pool

In pool.
None / None
Type: float
varnish.MEMPOOL.req0.randry

Pool ran dry.
event / second
Type: float
varnish.MEMPOOL.req0.recycle

Recycled from pool.
event / second
Type: float
varnish.MEMPOOL.req0.surplus

Too many for pool.
event / second
Type: float
varnish.MEMPOOL.req0.sz_needed

Size allocated.
byte / None
Type: float
varnish.MEMPOOL.req0.sz_wanted

Size requested.
byte / None
Type: float
varnish.MEMPOOL.req0.timeout

Timed out from pool.
event / second
Type: float
varnish.MEMPOOL.req0.toosmall

Too small to recycle.
event / second
Type: float
varnish.MEMPOOL.req1.allocs

Allocations.
event / second
Type: float
varnish.MEMPOOL.req1.frees

Frees.
event / second
Type: float
varnish.MEMPOOL.req1.live

In use.
None / None
Type: float
varnish.MEMPOOL.req1.pool

In pool.
None / None
Type: float
varnish.MEMPOOL.req1.randry

Pool ran dry.
event / second
Type: float
varnish.MEMPOOL.req1.recycle

Recycled from pool.
event / second
Type: float
varnish.MEMPOOL.req1.surplus

Too many for pool.
event / second
Type: float
varnish.MEMPOOL.req1.sz_needed

Size allocated.
byte / None
Type: float
varnish.MEMPOOL.req1.sz_wanted

Size requested.
byte / None
Type: float
varnish.MEMPOOL.req1.timeout

Timed out from pool.
event / second
Type: float
varnish.MEMPOOL.req1.toosmall

Too small to recycle.
event / second
Type: float
varnish.MEMPOOL.sess0.allocs

Allocations.
event / second
Type: float
varnish.MEMPOOL.sess0.frees

Frees.
event / second
Type: float
varnish.MEMPOOL.sess0.live

In use.
None / None
Type: float
varnish.MEMPOOL.sess0.pool

In pool.
None / None
Type: float
varnish.MEMPOOL.sess0.randry

Pool ran dry.
event / second
Type: float
varnish.MEMPOOL.sess0.recycle

Recycled from pool.
event / second
Type: float
varnish.MEMPOOL.sess0.surplus

Too many for pool.
event / second
Type: float
varnish.MEMPOOL.sess0.sz_needed

Size allocated.
byte / None
Type: float
varnish.MEMPOOL.sess0.sz_wanted

Size requested.
byte / None
Type: float
varnish.MEMPOOL.sess0.timeout

Timed out from pool.
event / second
Type: float
varnish.MEMPOOL.sess0.toosmall

Too small to recycle.
event / second
Type: float
varnish.MEMPOOL.sess1.allocs

Allocations.
event / second
Type: float
varnish.MEMPOOL.sess1.frees

Frees.
event / second
Type: float
varnish.MEMPOOL.sess1.live

In use.
None / None
Type: float
varnish.MEMPOOL.sess1.pool

In pool.
None / None
Type: float
varnish.MEMPOOL.sess1.randry

Pool ran dry.
event / second
Type: float
varnish.MEMPOOL.sess1.recycle

Recycled from pool.
event / second
Type: float
varnish.MEMPOOL.sess1.surplus

Too many for pool.
event / second
Type: float
varnish.MEMPOOL.sess1.sz_needed

Size allocated.
byte / None
Type: float
varnish.MEMPOOL.sess1.sz_wanted

Size requested.
byte / None
Type: float
varnish.MEMPOOL.sess1.timeout

Timed out from pool.
event / second
Type: float
varnish.MEMPOOL.sess1.toosmall

Too small to recycle.
event / second
Type: float
varnish.MEMPOOL.vbc.allocs

Allocations.
event / second
Type: float
varnish.MEMPOOL.vbc.frees

Frees.
event / second
Type: float
varnish.MEMPOOL.vbc.live

In use.
None / None
Type: float
varnish.MEMPOOL.vbc.pool

In pool.
None / None
Type: float
varnish.MEMPOOL.vbc.randry

Pool ran dry.
event / second
Type: float
varnish.MEMPOOL.vbc.recycle

Recycled from pool.
event / second
Type: float
varnish.MEMPOOL.vbc.surplus

Too many for pool.
event / second
Type: float
varnish.MEMPOOL.vbc.sz_needed

Size allocated.
byte / None
Type: float
varnish.MEMPOOL.vbc.sz_wanted

Size requested.
byte / None
Type: float
varnish.MEMPOOL.vbc.timeout

Timed out from pool.
event / second
Type: float
varnish.MEMPOOL.vbc.toosmall

Too small to recycle.
event / second
Type: float
varnish.MGT.child_died

Child processes that died due to signals.
process / second
Type: float
varnish.MGT.child_dump

Child processes that produced core dumps.
process / second
Type: float
varnish.MGT.child_exit

Child processes the were cleanly stopped.
process / second
Type: float
varnish.MGT.child_panic

Child processes that panicked.
process / second
Type: float
varnish.MGT.child_start

Child processes that started.
process / second
Type: float
varnish.MGT.child_stop

Child processes that exited with an unexpected return code.
process / second
Type: float
varnish.MGT.uptime
None / None
Type: float
varnish.SMA.Transient.c_bytes

Total space allocated by this storage.
byte / second
Type: float
varnish.SMA.Transient.c_fail

Times the storage has failed to provide a storage segment.
event / second
Type: float
varnish.SMA.Transient.c_freed

Total space returned to this storage.
byte / second
Type: float
varnish.SMA.Transient.c_req

Times the storage has been asked to provide a storage segment.
event / second
Type: float
varnish.SMA.Transient.g_alloc

Storage allocations outstanding.
event / None
Type: float
varnish.SMA.Transient.g_bytes

Space allocated from the storage.
byte / None
Type: float
varnish.SMA.Transient.g_space

Space left in the storage.
byte / None
Type: float
varnish.SMA.s0.c_bytes

Total space allocated by this storage.
byte / second
Type: float
varnish.SMA.s0.c_fail

Times the storage has failed to provide a storage segment.
event / second
Type: float
varnish.SMA.s0.c_freed

Total space returned to this storage.
byte / second
Type: float
varnish.SMA.s0.c_req

Times the storage has been asked to provide a storage segment.
event / second
Type: float
varnish.SMA.s0.g_alloc

Storage allocations outstanding.
event / None
Type: float
varnish.SMA.s0.g_bytes

Space allocated from the storage.
byte / None
Type: float
varnish.SMA.s0.g_space

Space left in the storage.
byte / None
Type: float
varnish.accept_fail
/
Type: float
varnish.backend_busy
/
Type: float
varnish.backend_conn
/
Type: float
varnish.backend_fail
/
Type: float
varnish.backend_recycle
/
Type: float
varnish.backend_req
/
Type: float
varnish.backend_retry
/
Type: float
varnish.backend_reuse
/
Type: float
varnish.backend_toolate
/
Type: float
varnish.backend_unhealthy
/
Type: float
varnish.bans
/
Type: float
varnish.bans_added
/
Type: float
varnish.bans_completed
/
Type: float
varnish.bans_deleted
/
Type: float
varnish.bans_dups
/
Type: float
varnish.bans_lurker_contention
/
Type: float
varnish.bans_lurker_obj_killed
object /
Type: float
varnish.bans_lurker_tested
/
Type: float
varnish.bans_lurker_tests_tested
/
Type: float
varnish.bans_obj
/
Type: float
varnish.bans_obj_killed
object /
Type: float
varnish.bans_persisted_bytes
byte /
Type: float
varnish.bans_persisted_fragmentation
byte /
Type: float
varnish.bans_req
/
Type: float
varnish.bans_tested
/
Type: float
varnish.bans_tests_tested
/
Type: float
varnish.busy_sleep
/
Type: float
varnish.busy_wakeup
/
Type: float
varnish.cache_hit
/
Type: float
varnish.cache_hitpass
/
Type: float
varnish.cache_miss
/
Type: float
varnish.client_conn
/
Type: float
varnish.client_drop
/
Type: float
varnish.client_drop_late
/
Type: float
varnish.client_req
/
Type: float
varnish.client_req_400
/
Type: float
varnish.client_req_411

Requests that were missing a Content-Length: header.
request / second
Type: float
varnish.client_req_413

Requests that were too big.
request / second
Type: float
varnish.client_req_417
/
Type: float
varnish.dir_dns_cache_full
/
Type: float
varnish.dir_dns_failed
/
Type: float
varnish.dir_dns_hit
/
Type: float
varnish.dir_dns_lookups
/
Type: float
varnish.esi_errors
/
Type: float
varnish.esi_warnings
/
Type: float
varnish.exp_mailed
object /
Type: float
varnish.exp_received
object /
Type: float
varnish.fetch_1xx
/
Type: float
varnish.fetch_204
/
Type: float
varnish.fetch_304
/
Type: float
varnish.fetch_bad
/
Type: float
varnish.fetch_chunked
/
Type: float
varnish.fetch_close
/
Type: float
varnish.fetch_eof
/
Type: float
varnish.fetch_failed
/
Type: float
varnish.fetch_head
/
Type: float
varnish.fetch_length
/
Type: float
varnish.fetch_no_thread
/
Type: float
varnish.fetch_oldhttp
/
Type: float
varnish.fetch_zero
/
Type: float
varnish.hcb_insert
/
Type: float
varnish.hcb_lock
/
Type: float
varnish.hcb_nolock
/
Type: float
varnish.losthdr
/
Type: float
varnish.n_backend
/
Type: float
varnish.n_ban
/
Type: float
varnish.n_ban_add
/
Type: float
varnish.n_ban_dups
/
Type: float
varnish.n_ban_obj_test
/
Type: float
varnish.n_ban_re_test
/
Type: float
varnish.n_ban_retire
/
Type: float
varnish.n_expired
/
Type: float
varnish.n_gunzip
/
Type: float
varnish.n_gzip
/
Type: float
varnish.n_lru_moved
/
Type: float
varnish.n_lru_nuked
/
Type: float
varnish.n_obj_purged

Purged objects.
object / None
Type: float
varnish.n_object
/
Type: float
varnish.n_objectcore
/
Type: float
varnish.n_objecthead
/
Type: float
varnish.n_objoverflow
/
Type: float
varnish.n_objsendfile
/
Type: float
varnish.n_objwrite
/
Type: float
varnish.n_purged_obj
object /
Type: float
varnish.n_purges
operation /
Type: float
varnish.n_sess
/
Type: float
varnish.n_sess_mem
/
Type: float
varnish.n_vampireobject
/
Type: float
varnish.n_vbc
/
Type: float
varnish.n_vcl
/
Type: float
varnish.n_vcl_avail
/
Type: float
varnish.n_vcl_discard
/
Type: float
varnish.n_waitinglist
/
Type: float
varnish.n_wrk
/
Type: float
varnish.n_wrk_create
/
Type: float
varnish.n_wrk_drop
/
Type: float
varnish.n_wrk_failed
/
Type: float
varnish.n_wrk_lqueue
/
Type: float
varnish.n_wrk_max
/
Type: float
varnish.n_wrk_queued
/
Type: float
varnish.pools

Thread pools.
None / None
Type: float
varnish.s_bodybytes
/
Type: float
varnish.s_fetch
/
Type: float
varnish.s_hdrbytes
/
Type: float
varnish.s_pass
/
Type: float
varnish.s_pipe
/
Type: float
varnish.s_pipe_hdrbytes
byte /
Type: float
varnish.s_pipe_in
byte /
Type: float
varnish.s_pipe_out
byte /
Type: float
varnish.s_req
/
Type: float
varnish.s_req_bodybytes
byte /
Type: float
varnish.s_req_hdrbytes
byte /
Type: float
varnish.s_resp_bodybytes
byte /
Type: float
varnish.s_resp_hdrbytes
byte /
Type: float
varnish.s_sess
/
Type: float
varnish.s_synth
/
Type: float
varnish.sess_closed
/
Type: float
varnish.sess_conn
/
Type: float
varnish.sess_drop
/
Type: float
varnish.sess_dropped
/
Type: float
varnish.sess_fail
/
Type: float
varnish.sess_herd
/
Type: float
varnish.sess_linger
/
Type: float
varnish.sess_pipe_overflow
session /
Type: float
varnish.sess_pipeline
/
Type: float
varnish.sess_queued
/
Type: float
varnish.sess_readahead
/
Type: float
varnish.shm_cont
/
Type: float
varnish.shm_cycles
/
Type: float
varnish.shm_flushes
/
Type: float
varnish.shm_records
/
Type: float
varnish.shm_writes
/
Type: float
varnish.sms_balloc
/
Type: float
varnish.sms_bfree
/
Type: float
varnish.sms_nbytes
/
Type: float
varnish.sms_nobj
/
Type: float
varnish.sms_nreq
/
Type: float
varnish.thread_queue_len

Length of session queue waiting for threads.
connection / None
Type: float
varnish.threads
/
Type: float
varnish.threads_created
/
Type: float
varnish.threads_destroyed
/
Type: float
varnish.threads_failed
/
Type: float
varnish.threads_limited
/
Type: float
varnish.threads_queue_len
/
Type: float
varnish.uptime
/
Type: float
varnish.vmods
/
Type: float
varnish.vsm_cooling

Space which will soon (max 1 minute) be freed in the shared memory used to communicate with tools like varnishstat, varnishlog etc.
byte / None
Type: float
varnish.vsm_free
byte /
Type: float
varnish.vsm_overflow
byte /
Type: float
varnish.vsm_overflowed
byte /
Type: float
varnish.vsm_used
byte /
Type: float

Metrics Conversion

Please refer to the metrics conversion document to map old metrics names to the new metric names.

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.