My varnish setup looks like this (obviously I've simplified):
director default round-robin {
{ .backend = me! }
}
director peers random {
{ .backend = peer1 }
{ .backend = peer2 }
{ .backend = peer3 }
}
And the vcl I'm wondering about:
if (req.restarts == 0) {
set req.backend = default;
} else {
set req.backend = peers;
}
What does varnish do when me! is sick (or really if all backends in the director are sick, only in my case it's 1/1)? Does it go to vcl_error immediately, and trigger a restart?
I want to know how it will handle max restarts. Say in this example, I only want to try twice before giving up. I always want try to get the page locally first, and then if that fails, try one of my peers. But, if I already know ahead of time that my local is sick, I still would like to be able to try 2 of my peers. Is there a way to set that up?