Strange behaviour using director random

duja at torlen.net duja at torlen.net
Thu Sep 25 11:33:45 CEST 2008


Im testing directors in varnish 2.0 beta 2 with two backends.

The thing is that only one machine is getting all the traffic when using random directors and .weight = 1 on both backends.

It seems like the last assigned backend in the director is the one that's getting all the traffic.

If I use probing on the backends they both work.

[VCL]
backend child_1 {
        .host = "192.168.0.192";
        .port = "80";
/*
        .probe = {
                .url = "/Portals/0/logo1.gif";
                .timeout = 1s;
                .interval = 1s;
                .window = 8;
                .threshold = 6;
        }
*/
}


backend child_2 {
        .host = "192.168.0.193";
        .port = "80";
/*
        .probe = {
                .url = "/Portals/0/logo1.gif";
                .timeout = 100 ms;
                .interval = 1s;
                .window = 10;
                .threshold = 8;
        }
*/
}

director www_director random {
        {
          .backend = child_2;
          .weight = 1;
        }

        {
          .backend = child_1;
          .weight = 1;
        }

}
sub vcl_recv {

        set req.backend = www_director;

        # Cacha endast filer av denna filtyp
        # *.jpg , *.jpeg , *.gif , *.png, *.js , *.css , *.swf
        if (req.url ~ "\.(jpg|gif|png|js|css|swf)$") {

                lookup;
        }

        pass;

} #RECV

sub vcl_fetch {

        # Cacha endast filer av denna filtyp
        # *.jpg , *.jpeg , *.gif , *.png, *.js , *.css , *.swf
        if (req.url ~ "\.(jpg|gif|png|js|css|swf)$") {
                set obj.ttl = 1h;
                deliver;
        }

        pass;

} #FETCH
[/VCL]

In this case child_1 is getting all the traffic.
If I switch child_1 with child_2 in the director then child_2 is the one that gets all the traffic.

/ E




More information about the varnish-misc mailing list