Tag Archives: varnish

Take backend out of rotation in varnish

When using Varnish and multiple backends it’s sometimes convenient to remove a particular backend without restarting the service Please note that this requires a Varnish version of at least 3.0.3 to work.

To remove a backend issue the following commands:

root@lb-01:~# varnishadm -T localhost:6082 -S /etc/varnish/secret
varnish> backend.set_health backend01 sick
200
varnish>

To re-add it to rotation use the following commands:

root@lb-01:~# varnishadm -T localhost:6082 -S /etc/varnish/secret
varnish> backend.set_health backend01 auto
200
varnish>

backend01 are backend name that can be required by issuing backend.list in the Varnish cli.