Created
March 21, 2017 15:48
-
-
Save razvanphp/c1b714ed68e9d964bc860f2b0e266381 to your computer and use it in GitHub Desktop.
round robin backends in varnish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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