Created
June 14, 2012 11:59
-
-
Save gerhard/2929885 to your computer and use it in GitHub Desktop.
nginx upstream fail_timeout not respected
This file contains 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
$ time curl -I "$uri" &> /dev/null | |
# when routed to the host that is up | |
curl -I "$uri" &> /dev/null 0.00s user 0.00s system 2% cpu 0.299 total | |
# when routed to the host that is down. Should this be ~3s as per fail_timeout & max_fails? | |
curl -I "$uri" &> /dev/null 0.00s user 0.00s system 0% cpu 21.304 total |
This file contains 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
upstream master_apache { | |
server master-local max_fails=3 fail_timeout=1s; # up and available | |
server slave-local max_fails=3 fail_timeout=1s; # temporarily down | |
keepalive 4; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The servers configured in the upstream are saying: "consider me down if I fail 3 times within 1s". Upping the
fail_timeout
to 30s and setting a 2sproxy_connect_timeout
did the trick.