1

Our setup is a varnish in-front serving 2 backends with configured health polling. We use client director for load balancing, so the backend is picked based on client.identity

When one of the two backends fails, varnish successfully sets this backend as Sick, however we see visitors receiving database errors because they are being sent to the Sick backend!

I've searched varnish documentation and I haven't found anything specific for 'client director', I've seen alot of 'round-robin' where they explicitly say that varnish won't use the sick backend but nothing for 'client director'.

Can anyone verify that when varnish uses 'client director' will not choose the sick backend ? that way I'd know there is a faulty configuration somewhere and it's not a varnish bug.

lrkwz
  • 6,105
  • 3
  • 36
  • 59
papasj
  • 151
  • 1
  • 2
  • 5
  • I have the same behavior using Varnish 3.0.7, client director and in ```sub vcl_recv{ ... return(pass); }``` – lrkwz Feb 24 '17 at 16:39

1 Answers1

-1

if you have setup the probe correctly varnish will not use the sick backends

backend yourbackend {
.host = "hostname or ip";
.probe = {
        .url = "/youprobe";
        .timeout = 1s;
        .interval = 5s;
        .window = 10;
        .threshold = 8;
    }
}

you can check for the backend health by using debug.health in your varnish console

for more information please check https://www.varnish-cache.org/trac/wiki/BackendPolling

Brian van Rooijen
  • 1,906
  • 1
  • 14
  • 10
  • 1
    thank you for taking the time to answer, however I'm questioning the implementation of varnish selection of a healthy backend when using a client director. I have correctly setup the backend polling, I see the backend sick so I'm thinking that varnish should not send any traffic to this backend, unfortunately I get a Database Error in my browser (meaning varnish sends me to the unhealthy backend). When i repeat the test using round-robin I'm not seing any database errors, meaning I'm never sent to the sick backend. – papasj Apr 15 '15 at 09:47
  • At the very end of the page you are pointing to "_Backends, directors and health state: We will not attempt to open a TCP connection to a backend marked unhealthy by polling. The random director will not consider backends which are unhealthy part of the pool. The round-robin director will skip unhealthy backends._" nothing is told about **client director** – lrkwz Feb 24 '17 at 16:45