Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Perhaps to reopen the conversation from #71, I have ported just the least connections algorithm to the master branch. We have abandoned the weighted and slow start that complicated the previous implementation. We have been using
LEAST
in production for > 5 years. We've tried switching back to the defaultRR
implementation but experience issues when one of our backends runs slowly.As you noted in #71 it isn't a guarantee of least connections (as the connection is not reserved) however we are treating it as a heuristic, and as such it has worked really well for us.
Again, if you're interested, I am happy to work this code to get it into a shape you like. I've tried to reproduce the basic logic from
dom_find
indom_find_leastconn
without worrying about thealt
behaviour as it usesdom_find
as a fall-back anyway. I look forward to hearing your thoughts when you have the time & energy!