Varnish Custom Statistics

Installation

Released with Varnish Custom Statistics version 6.0.

Overview

Installing Varnish Custom Statistics involves:

  • Installing the vcs software on a server.
  • Installing vcs-agent on your Varnish Cache Plus servers.
  • Initial configuration of vcs, and vcs-agent.

After a successful installation vcs’s HTTP interface will be listening on port 6555 on the server. It will also listen for incoming messages from the vcs-agent instances on port 5558.

Installing VCS

In order to install VCS on either Debian/Ubuntu or Redhat Enterprise, you need access to the Varnish Plus software repository. Please contact support at support@varnish-software.com for help with this step.

Debian / Ubuntu install

If you are installing on Debian or Ubuntu, use the provided packages in the Varnish Plus software repository.

  • Add the Varnish Plus repository.

  • Update and install

sudo apt-get update
sudo apt-get install varnish-custom-statistics

After the Varnish Custom Statistics server is installed, you need to install the agent component on each of your Varnish servers. Add the Varnish Plus repository to each Varnish server and then update and install:

sudo apt-get update
sudo apt-get install varnish-custom-statistics-agent

Redhat Enterprise Linux install

Currently RPMs for RHEL6 and RHEL7 compatible derivatives are available.

These depend on some packages from the EPEL repository. To make the entire EPEL repository available on your host, follow the EPEL documentation

Once EPEL is configured add the Varnish Plus yum repository. Please contact support at support@varnish-software.com for help with this step.

Install VCS on a server:

sudo yum update
sudo yum install varnish-custom-statistics

In addition, you might need to configure the firewall to allow incoming traffic to port 6555 and 5558. This is done either by editing the /etc/sysconfig/iptables file or by using the system-config-securitylevel-tui tool.

After the Varnish Custom Statistics server is installed, you need to install the agent component on each of your Varnish servers. Do this by using the same yum repo configuration as you did for the server and then do:

sudo yum update
sudo yum install varnish-custom-statistics-agent

VCS Agent configuration (vcs-agent)

Point the VCS agent to the VCS server. This requires editing the vcs-agent systemd configuration:

sudo systemctl edit vcs-agent

Add the following lines:

[Service]
ExecStart=
ExecStart=/usr/sbin/vcs-agent -d a.b.c.d

Replace a.b.c.d with the IP or hostname of the VCS server.

To enable and start the vcs-agent, you can run the following:

sudo systemctl enable vcs-agent
sudo systemctl start vcs-agent

You can find the full set of the vcs-agent command parameters here

For advanced VCL based key configuration, please see Use Cases

VCS configuration (vcs)

vcs is configured by editing its systemd configuration.

By default, vcs will track aggregated statistics in 30 second buckets, with total 15 buckets of history for each key. This gives you 7 minutes of history. These parameters are configurable with the -b and -m parameters, respectively.

To change this to 100 buckets of 30 minutes (2 days of data):

sudo systemctl edit vcs

Write the following lines:

[Service]
ExecStart=
ExecStart=/usr/sbin/vcs -P /var/run/vcs.pid -Z -b 1800 -m 100

Internally, vcs tracks all keys in a hash table. For optimal performance, the size of this table should be at least as large as the number of unique keys you end up tracking. The default size is 20000, and is configurable with the -s parameter.

To enable and start the vcs server, run the following:

sudo systemctl enable vcs
sudo systemctl start vcs

You can find the full set of the vcs command parameters here

Getting help

All inquiries can be directed to support@varnish-software.com. We’d be very happy to hear about your VCS usage and any suggestions you might have.