Varnish Backend polling

Varnish can poll the backend to see if it's healthy or dead.

Config snippet:
backend default {
        .host = "127.0.0.1";
        .port = "8080";
        .probe = {
                .timeout = 100ms;
                .interval = 1s;
                .window = 5;
                .threshold = 4;
                # .url = "/test.html";
                .request =
                        "GET /test.html HTTP/1.1"
                        "Host: sys-notes.com"
                        "Connection: close"
                        "User-Agent: varnish-probe"
                        "Accept: */*";
        }
}
You can specify either .request or .url but not both.
  • .window is the number of probe results to consider
  • .threshold - minimal number of good results (out of last .window results) to consider the backend healthy
  • It is a good practice to set the User-Agent header as many webservers configuration filter empty useragent to defend from bots.

Nginx specific notes

  • If nginx needs to proxy the request (E.g. to fastcgi) then the request will fail with error 499 because it is closed too early.

-- AvishaiIshShalom - 06 Aug 2009
Topic revision: r2 - 24 Jul 2010 - 10:01:44 - AvishaiIshShalom
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback