Tries #3

wants to merge 2 commits into


None yet
2 participants

ajwans commented Jun 4, 2012

As discussed here are the tests and a patch which try all the peers in an upstream block.

ajwans added some commits Jun 1, 2012

@ajwans ajwans Add tests
Add some tests to exercise some functionality which appears broken
when hash_again is set to the default (unset in the configuration)

The subsequent patch attempts to repair these problems.
@ajwans ajwans Fix tries counter.
Only decrement the tries counter when selecting an upstream server
that has not already been tried.

Decrementing the counter as part of the loop condition was prematurely
exiting the loop when the rehash hit on an upstream server which had
already been tried.

Ignore the hash_again parameter because now we'll try every peer in the
upstream block before failing.

evanmiller commented Jul 17, 2012

I'm not sure I like this. hash_again purposefully limits the number of servers that will be tried so that if a large number go down the rest won't be overwhelmed with requests. Also if there are a large number of backend servers you probably want to give up quickly so Nginx doesn't have too many requests pending.

ajwans commented Jul 19, 2012

Perhaps the default should be MIN(10, nservers) or some other reasonable value. The existing default of 1 does not seem adequate.


evanmiller commented Jan 17, 2013

I think 1 is a reasonable default, and since it can be configured I am closing the issue.

evanmiller closed this Jan 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment