varnish (3)

2010-01-02T00:00:00+09:00 varnish

varnishを使ってヘルスチェックをする事もできるっぽい

director director_www round-robin {
    {
        .backend = {
            .host = "192.168.1.1";
            .port = "8080";
            .probe = {
                .url = "/";
                .interval = 10s;
                .window = 5;
                .threshold = 3;
            }
        }
    }
    {
        .backend = {
            .host = "192.168.1.2";
            .port = "8080";
            .probe = {
                .url = "/";
                .interval = 10s;
                .window = 5;
                .threshold = 3;
            }
        }
    }
}

sub vcl_recv {
    set req.backend = director_www;
    pass;
}

varnish (4) varnish (2)