June 10, 2014
3 min read time

Introducing the Varnish Tuner

Varnish Cache is a high performance web application accelerator that performs very good out of the box. The default parameters have evolved since the start of the project, and they fit fine for a small site or a developer installation. However in order to run Varnish at scale you might want to tune it a bit to make it perform and scale even better. 

The biggest potential for improvement is outside Varnish. First and foremost in tuning the network stack and the TCP/IP connection handling.

Until now we’ve maintained quite a bit of documentation in English describing how to tune a system. Our experience is that English isn’t ideal for that sort of information. Describing it in programming language is easier, faster and more practical. So, we’ve written a tuner program based on the experience and documentation we’ve built up. The resulting toolkit is called “the Varnish Tuner”.

What parameters to tune depend on things that are unique for each environment. The toolkit tries to gather as much information as possible and decides which parameters need tuning. The tuning advice that the toolkit gives is of course specific to that system. Copying it verbatim to other systems might not be a good idea.

The Varnish Tuner will gather information from the system it is running in, and based on the information - it will make suggestions consisting of:

  • Which tunables that should be changed - both for the OS and for Varnish
  • The current value of those parameters.
  • The suggested new value of those parameters.
  • A text explaining why that parameter should be changed.

We think the Varnish Tuner will be valuable to both experts and non-experts. Varnish Tuner is shipping today and is available to our Varnish Plus subscribers. It’s in our repositories now. If you have a Varnish Plus subscription you can get it today.

Installation

Below are the installation instructions for getting the tuner from our repositories. Please replace the username/passwords with the ones that you are currently using. If you don't know what they are, please send an email to our support and we'll let you know. 

Ubuntu Precise (12.04)

Packages in our repositories are signed and distributed via https. You need to enable https support in the package manager and install our public key first:

apt-get install -y apt-transport-https
curl https://username:password@repo.varnish-software.com/GPG-key.txt | apt-key add -

To use Varnishtuner add the following to /etc/apt/sources.list.d/varnish-plus.list:

# Varnishtuner
deb https://username:password@repo.varnish-software.com/ubuntu precise non-free

Debian Stable (Wheezy)

Packages in our repositories are signed and distributed via https. You need to enable https support in the package manager and install our public key first:

apt-get install -y apt-transport-https
curl https://username:password@repo.varnish-software.com/GPG-key.txt | apt-key add -

To use Varnishtuner add the following to /etc/apt/sources.list.d/varnish-plus.list:

# Varnishtuner
deb https://username:password@repo.varnish-software.com/debian wheezy non-free

RHEL 6

To install Varnish Plus on RHEL6, please put the following lines into /etc/yum.repos.d/varnish-plus.repo:

[varnishtuner]
name=Varnishtuner
baseurl=https://username:password@repo.varnish-software.com/redhat/varnishtuner/el6
enabled=1
gpgcheck=0

Image (c) 2014 Stephen Donaghy used under Creative Commons license.