Skip to content

Instantly share code, notes, and snippets.

@razvanphp
Created March 21, 2017 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save razvanphp/c1b714ed68e9d964bc860f2b0e266381 to your computer and use it in GitHub Desktop.
Save razvanphp/c1b714ed68e9d964bc860f2b0e266381 to your computer and use it in GitHub Desktop.
round robin backends in varnish
import directors;
backend ay_p_www1 {
.host = "10.10.0.137";
.port = "80";
.probe = {
.url = "/status";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
}
}
backend ay_p_www2 {
.host = "10.10.0.138";
.port = "80";
.probe = {
.url = "/status";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
}
}
# …
sub vcl_init {
new cluster = directors.round_robin();
cluster.add_backend(ay_p_www1);
cluster.add_backend(ay_p_www2);
# …
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment