Questiona about req.backend.healthy

Rangel, Raul Raul.Rangel at disney.com
Wed Jun 12 16:45:01 CEST 2013


Oops,
I guess you can't reference the backend like I said.

In that case just check req.backend.healthy because you already assigned the backend to the request.

Raul

-----Original Message-----
From: Marco Felettigh [mailto:marco at nucleus.it] 
Sent: Wednesday, June 12, 2013 8:40 AM
To: Rangel, Raul
Cc: 'varnish-misc at varnish-cache.org'
Subject: Re: Questiona about req.backend.healthy

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



More information about the varnish-misc mailing list