[collectd] Varnish plugin

Marc Fournier marc.fournier at camptocamp.com
Wed Jun 16 19:56:15 CEST 2010


Hello,


On Fri, Jun 11, 2010 at 10:51:03AM +0200, Florian Forster wrote:
> 
> I'm currently thinking about moving information from the type instance
> to the plugin instance. [...]
> 
> If we move some of the information into the plugin instance, the data is
> structured better:
> 
>   host/varnish-default-storage-file/...
>     .../total_requests
>     .../requests-outstanding
>     .../bytes-allocated
>     .../bytes-free
>   host/varnish-default-storage-mem/...
>     .../total_requests
>     .../requests-outstanding
>     .../bytes-outstanding
>     .../bytes-allocated
>     .../bytes-free
>   host/varnish-default-storage-synth/...
>     .../total_requests
>     .../requests-outstanding
>     .../bytes-outstanding
>     .../bytes-allocated
>     .../bytes-free

You'll find an implementation suggestion in this branch:

http://github.com/mfournier/collectd/commits/varnish-data-reorg

As I'm no C expert, please be indulgent :-P Comments welcome !

This modification allow this config:

<Plugin varnish>
  <Instance>
    CollectCache       true
    CollectConnections true
    CollectBackend     false
    CollectSHM         false
  </Instance>
  <Instance "lonquimay">
    CollectTotals      true
    CollectWorkers     true
    CollectCache       false
    CollectBackend     false
    CollectSHM         false
  </Instance>
</Plugin>

to dispatch the values in directories following this structure:

lonquimay.wrk.lsn.camptocamp.com/
lonquimay.wrk.lsn.camptocamp.com/varnish-default-cache
lonquimay.wrk.lsn.camptocamp.com/varnish-default-cache/cache_result-hitpass.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-default-cache/cache_result-hit.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-default-cache/cache_result-miss.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-default-client
lonquimay.wrk.lsn.camptocamp.com/varnish-default-client/connections-accepted.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-default-client/connections-dropped.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-default-client/connections-received.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-client
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-client/connections-accepted.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-client/connections-dropped.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-client/connections-received.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-n_wrk
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-n_wrk/threads-worker.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-n_wrk/total_requests-dropped.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-n_wrk/total_requests-overflowed.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-n_wrk/total_requests-queued.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-n_wrk/total_threads-created.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-n_wrk/total_threads-failed.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-n_wrk/total_threads-limited.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-s
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-s/total_bytes-body-bytes.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-s/total_bytes-header-bytes.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-s/total_operations-fetches.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-s/total_operations-pass.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-s/total_operations-pipe.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-s/total_requests-requests.rrd
lonquimay.wrk.lsn.camptocamp.com/varnish-lonquimay-s/total_sessions-sessions.rrd


A couple of thoughts:

 - as I understood, the plugin instance name is limited to 64 characters
   (DATA_MAX_NAME_LEN). This could be an issue with long instance names. As
   the trailing part gets truncated, we could end up having
   varnish-quite_long_instance_name_more_than_64_characters_long-{sm,sma,sms}/bytes-allocated.rrd
   ending as one same file.

 - would it make more sense to name the directories after the configuration
   option ? ie: CollectWorkers -> varnish-instance-workers. They actually
   match the varnish values names (same than returned by "varnishstat -l").

> Here, "default" is the Varnish instance name (which would no longer be
> allowed to be empty).

This is in the 2nd patch in my "varnish-data-reorg" branch.

Cheers,
Marc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100616/8b2f19be/attachment.pgp 


More information about the collectd mailing list