Questiona about req.backend.healthy

Marco Felettigh marco at nucleus.it
Wed Jun 12 16:40:23 CEST 2013


Ok thanks but if i write 

sub vcl_recv {
    set req.backend = be1;
    if (be1.healthy) {
    set req.grace = 30s;
    std.log("###################### Grace 30s");
  } else {
    std.log("###################### Grace 1h");
    set req.grace = 1h;
  }	
...

and restart Varnish the compiler fails.

Message from VCC-compiler:
Symbol not found: 'be1.healthy' (expected type BOOL):
('input' Line 125 Pos 9)
    if (be1.healthy) {
--------###############---

Running VCC-compiler failed, exit 1

I'm missing something ?

Thanks


On Wed, 12 Jun 2013 07:15:11 -0700
"Rangel, Raul" <Raul.Rangel at disney.com> wrote:

> req.backend is the default backend you have selected. If you want
> your request to go to a specific backend just set req.backend = be1;
> 
> You can reference each individual backend by name. So be1.healthy, or
> be2.healthy.
> 
> Raul
> 
> -----Original Message-----
> From: varnish-misc-bounces+raul.rangel=disney.com at varnish-cache.org
> [mailto:varnish-misc-bounces+raul.rangel=disney.com at varnish-cache.org]
> On Behalf Of Marco Felettigh Sent: Wednesday, June 12, 2013 6:49 AM
> To: varnish-misc at varnish-cache.org Subject: Questiona about
> req.backend.healthy
> 
> Hi ,
> i'am new about Varnish and i need help understanding
> req.backend.healthy .
> 
> req.backend.healthy is a state for all the backends or i can check
> the healthy of a single backend ? How can i grace only the content
> from a single backend ?
> 
> site1 -> be1
> site2 -> be2
> 
> example:
> backend be1 {
>    .host = "x.x.x.x";
>    .port = "80";
>    .probe = {
>    .url = "/index.php";
>    .interval = 5s;
>    .timeout = 1 s;
>    .window = 5;
>    .threshold = 3;
>   }
> }
> 
> backend be2 {
>    .host = "y.y.y.y";
>    .port = "80";
>    .probe = {
>    .url = "/index.php";
>    .interval = 5s;
>    .timeout = 1 s;
>    .window = 5;
>    .threshold = 3;
>   }
> }
> 
> 
> thanks
> Marco
> 



-- 
----
  Cordiali saluti
    Marco Felettigh
    Nucleus S.r.l.
    Tel. 0432526336
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20130612/1bf5b321/attachment.pgp>


More information about the varnish-misc mailing list