Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Least connected load balancing strategy #385

Merged
merged 6 commits into from
Jul 10, 2017

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Jul 5, 2017

Based on #384

Round-robin load balancing was previously coupled with the address
set implementation and made it hard to use different load balancing
algorithm.

This commit turns RoundRobinAddressSet into a simple concurrent set of
addresses and moves load balancing logic into a separate component that
takes list of available addresses and returns one that should be used
next. This allows easier implementation of new load balancing
algorithms. Rediscovery procedure will now not use load balancing and
query routers in a known order (which is randomized by the database).
This replaces the existing round-robin. It gives us better performance
with clusters composed of different machine capacities.
Lease connected load balancing strategy selects start index in
round-robin fashion to avoid always selecting same machine when cluster
does not have any running transactions or
all machines have same number of active connections.
@zhenlineo zhenlineo merged commit 798b4a0 into neo4j:1.5 Jul 10, 2017
@lutovich lutovich deleted the 1.5-least-connected branch July 10, 2017 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants