req.restarts in rc1

jean-marc pouchoulon jeanmarc.pouchoulon at gmail.com
Sat Oct 11 18:46:57 CEST 2008


Hi,

Poul-Henning Kamp a écrit :
>
> At this point we _really_ urge everybody to upgrade to Varnish 2.0.
>   
Done for me in prod but I 've got a problem with this conf.
If  I stopped b3 backend got an error 503 and no failover

....
backend b3 {
     .host = ".....";
     .port = ".....";
     .probe = {
                .request =
                "GET / HTTP/1.1"
                "Host: ..."
                "Connection: close";
                .timeout = 1s;
                .interval = 5s;
                .window = 4;
                .threshold = 2;
     }
}


backend b4 {
     .host = "...";
     .port = "...";
     .probe = {
                .request =
                "GET / HTTP/1.1"
                "Host: ...."
                "Connection: close";
                .timeout = 1s;
                .interval = 5s;
                .window = 4;
                .threshold = 2;
     }
}

sub vcl_fetch {
        set obj.grace = 30s;
        if (obj.ttl < 600s) {
                set obj.ttl = 600s;
        }

        if (obj.status != 200 && obj.status != 302 && obj.status != 403 
&& obj.status != 404 ) {
                restart;
         }

}

sub vcl_recv {

 set req.grace = 30s;

 if (req.url ~ "/dir") {
               if (req.restarts == 0) {
                       set req.backend = b1;
                } else {
                       set req.backend = b2;
                }
     } else {
               if (req.restarts == 0) {
                       set req.backend = b3;
                } else {
                       set req.backend = b4;
                }
     }


    4 RxHeader     c Cache-Control: no-cache, max-age=259200
    4 RxHeader     c Connection: keep-alive
    4 VCL_call     c recv
    4 VCL_return   c lookup
    4 VCL_call     c hash
    4 VCL_return   c hash
    4 VCL_call     c miss
    4 VCL_return   c fetch
    4 VCL_call     c error
    4 VCL_return   c deliver
    4 Length       c 451
    4 VCL_call     c deliver
    4 VCL_return   c deliver
    4 TxProtocol   c HTTP/1.1
    4 TxStatus     c 503
    4 TxResponse   c Service Unavailable
    4 TxHeader     c Server: Varnish
    4 TxHeader     c Retry-After: 0
    4 TxHeader     c Content-Type: text/html; charset=utf-8
    4 TxHeader     c Content-Length: 451
    4 TxHeader     c Date: Sat, 11 Oct 2008 16:28:46 GMT
    4 TxHeader     c X-Varnish: 43575121
    4 TxHeader     c Age: 0
    4 TxHeader     c Via: 1.1 varnish
    4 TxHeader     c Connection: close
    4 ReqEnd       c 43575121 1223742526.863905191 1223742526.864029646 
0.001247644 0.000095606 0.000028849
    4 SessionClose c error

  Problem or Bad conf ?

  I'm using director and Fail Over is working fine
 
  jean-marc
  

> The release candidate 1 was released this week, and we are ready to
> cut the release now.
>
> Poul-Henning
>
> PS: for those who can attend, there is a release party in Oslo
> on 2008-10-21, email varnish at linpro.no for details.
>
>   






More information about the varnish-misc mailing list