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.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.