[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
 object
 +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
 respect
 +that.
 <phk> perbu, yes, we should grace when the polling marks the backend down
 as
 +well.
 <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
 of
 +polling. For example if replies from the backend have the wrong http
 code,
 +grace would be preferred..
 > In such situations, it would preferable to deliver the graced object,
 and
 +even extend the grave time.. :)
  <phk> anordby, in that case, you need to do a restart to take another
 attempt
  <phk> anordby, we are simply too far down the road at that time to make a
 +determination
 <phk> or said another way: we would have to do exactly the same work as
 you
 +end up doing with restart
 > phk: If all backends fail at around the same time, restart does not
 help.
  <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
 as
 +often as possible, if interval is not defined? This lead to huge amounts
 of
 +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
 runtime,
 +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