Assuming your cache is hot enough, you should be able to keep things
going with this in recv
if (req.backend.healthy) {
set req.grace = 60s;
} else {
set req.grace = 4h;
}
If your backends all go away, grace is what saves you, but you need the
cache to be well heated.
Stefan Caunter :: Senior Systems Administrator :: TOPS
e: [email protected] :: m: (416) 561-4871
www.thestar.com www.topscms.com
From: [email protected]
[mailto:[email protected]] On Behalf Of Vitaly
Burshteyn
Sent: June-01-10 12:28 PM
To: [email protected]
Subject: wont server from Cache
Hi folks,
So I sent this post few days ago, I have made some changes but still
cant get my varnish box to server content from cache even though it
looks like it is:
232 Client requests received
130 Cache hits
5 Cache hits for pass
97 Cache misses
99 Backend conn. success
3 Backend conn. failures
99 Fetch with Length
15 N struct sess_mem
When I shut down the web server it gives me a 503 error.
Here is the copy of my vcl file with out the backend info.. Any and all
suggestion would be appreciated.
sub vcl_recv {
#set req.backend = bw;
set req.grace = 60m;
if (req.request == "PURGE")
{if (!client.ip ~ purge)
{error 405 "Not allowed.";}
return(lookup);}
if (req.request != "GET" && req.request != "HEAD")
{return(lookup);}
if (req.http.Cache-Control ~ "no-cache")
{purge_url(req.url);}
return(lookup);
}
sub vcl_hit {
if (!obj.cacheable) {
return(pass); }}
sub vcl_fetch {
if (beresp.status == 500 || beresp.status == 503 || beresp.status ==
504) {
restart; }
set beresp.ttl = 600s;
set beresp.grace = 600s;
if (beresp.ttl < 300s) {
set beresp.ttl = 300s;}
if (!beresp.cacheable)
{return(pass);}
if (beresp.http.Set-Cookie)
{return(pass);}
}
Vitaly Burshteyn
Senior Network Engineer
Broadway.com, Theatre Direct International
729 7th Avenue
New York, New York 10019
Phone: 212.817.9117
Cell# 917-701-5732
_______________________________________________
varnish-misc mailing list
[email protected]
http://lists.varnish-cache.org/mailman/listinfo/varnish-misc