saintmode with multiple backends

Ereboos ereboos at googlemail.com
Fri Jun 18 13:01:36 CEST 2010


Hello,

In my configuration I have multiple backends which are loadbalanced with 
a director.
I now want to enable saintmode in such a way that if a request fails 
with >=500 error code
this url is blocked for the next X minutes _for_all_ backends in this 
director, so the infrastructure
gets a chance to recover [1]. During that recovery time old content 
should be delivered instead
of the 50x error message (I am able to achieve this with the grace mode)

In my current configuration I use this vcl_fetch:
sub vcl_fetch {
    set beresp.grace = 1h;

    if ( beresp.status == 503 ) {
        set beresp.saintmode = 20s;
        restart;
    }
}

the problem is that restart will lead to the same request sent to the 
next backend and only if all backends failed the grace is done.
Do you have any ideas how I can solve this?

thank you in advance,
Markus





[1] the http backends rely on some replicated database servers which 
often cause lock problems. So if a request fails on one http server no other
http server will be able to handle it.




More information about the varnish-misc mailing list