Cache'ing request despite PASS

Krzysztof Dajka alteriks at gmail.com
Tue May 24 00:04:04 CEST 2011


Well, saintmode is another way to tell if your director is sick. If
you use it like this (taken from wiki):
sub vcl_fetch {
   if (beresp.status == 500) {
      set beresp.saintmode = 20s;
      restart;
   }
   set beresp.grace = 1h;
}

Varnish will try getting object from healthy backend, if it fails -
all backend returned 500 status code, it won't try getting fresh
object for next 20 seconds and will respond with stale one. We also
have varnishd parameter - saintmode_threshold by default set to 10. If
I remember correctly after trying to fetch 10 different objects,
varnish will mark whole director as sick it before probes would say
so.


2011/5/23 Lukas Kahwe Smith <mls at pooteeweet.org>:
>
> On 23.05.2011, at 23:16, Krzysztof Dajka wrote:
>
>> From my observations, grace only works when object is already cached
>> in varnish, it doesn't work unless object has been HIT. In case when
>> all backends are sick grace just keeps object in memory even if
>> expires/ttl has ran out. Object is STALE for amount of time set in
>> grace.
>>
>> I'm already using grace for static objects on my websites, but I'd
>> like to cache htmls which currently are passed to cms backends. I'd
>> like to serve stale objects only in case of disaster in my cms. Has
>> anyone created acl based for example on googlebot IP addresses and
>> cache htmls which are crawled by bots and serve them only in case
>> whole cms director went down? I think it sounds nice but I haven't
>> tried that yet.
>
>
> so what you want is saint mode?
>
> regards,
> Lukas Kahwe Smith
> mls at pooteeweet.org
>
>
>
>




More information about the varnish-misc mailing list