[Varnish] #369: Enable serving of graced objects if backend is down

Varnish varnish-bugs at projects.linpro.no
Sat Nov 8 18:54:50 CET 2008

#369: Enable serving of graced objects if backend is down
 Reporter:  perbu        |        Owner:       
     Type:  enhancement  |       Status:  new  
 Priority:  normal       |    Milestone:       
Component:  build        |      Version:  trunk
 Severity:  normal       |   Resolution:       
 Keywords:               |  
Comment (by anders):

 I also want to be able to serve graced objects, and to control it from
 VCL. Please give us force_grace!

 Excerpt from IRC conversation:

 <perbu> phk: is it hard to lift the limitation on the grace that the
 +has to be busy in order for the graced object to be served?
 <perbu> I understand that normally the limitation should be in place - but
 +when the backend is down it would be really useful.
 <perbu> i've tried forcing a lookup in vcl - but it doesn't seem to
 <phk> perbu, yes, we should grace when the polling marks the backend down
 <phk> perbu, open a ticket so we remember
 <perbu> phk: ack.
 > This is very interesting for me too.
 > It would be nice to control this grace in VCL as well, not just because
 +polling. For example if replies from the backend have the wrong http
 +grace would be preferred..
 > In such situations, it would preferable to deliver the graced object,
 +even extend the grave time.. :)
  <phk> anordby, in that case, you need to do a restart to take another
  <phk> anordby, we are simply too far down the road at that time to make a
 <phk> or said another way: we would have to do exactly the same work as
 +end up doing with restart
 > phk: If all backends fail at around the same time, restart does not
  <phk> anordby, the trick is to make the restart do grace before trying to
 +contact the backend.
 > Yes. But something needs to be done for that to happen, I suppose ?
 <phk> I guess you're right, we need to say "don't even try, just grace"
 > I just recently started to play with Varnish' load balancing ability.
 > One thing I found out quickly, default interval is 0? Meaning it'll poll
 +often as possible, if interval is not defined? This lead to huge amounts
 +traffic and CPU usage way beyond expected. :-)
 > Maybe there should be a default .interval of one or two seconds?
  <phk> anordby, ticket
 > Ok, I will. There could also be some issues related to loading VCL
 +I'll check that too.
 > It would be nice to also say "try restart 2 times, then grace" in VCL.
 <phk> well, you can, it would be something like "sub vcl_recv { if (req.
 +restart == 3) { force_grace; }}
 <Mithrandir> s/restart/&s/, though
 > Amen
 > (Let it happen) :)

Ticket URL: <http://varnish.projects.linpro.no/ticket/369#comment:1>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator

More information about the varnish-bugs mailing list