add new loadbalance strategy#6064
Merged
mercyblitz merged 3 commits intoapache:masterfrom May 6, 2020
Augustvic:master
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6064 +/- ##
============================================
- Coverage 61.18% 61.15% -0.03%
+ Complexity 493 491 -2
============================================
Files 991 992 +1
Lines 39597 39636 +39
Branches 5719 5727 +8
============================================
+ Hits 24227 24240 +13
- Misses 12690 12710 +20
- Partials 2680 2686 +6 Continue to review full report at Codecov.
|
vergilyn
pushed a commit
to vergilyn/dubbo-fork
that referenced
this pull request
May 28, 2020
* add new loadbalance strategy * add note * Update ShortestResponseLoadBalanceTest.java (cherry picked from commit 6d2ba7e)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is the purpose of the change
Add new loadbalance strategy based on response time.
Brief changelog
LeastActiveRoadBalance will not work properly when the performance of servers are quite different. The worst provider may have reached limit, then the best one may still free.
This strategy is much similar to the LeastActiveRoadBalance, but chooses response time of success calls instead of active connection.
We calculate the estimated response time from the product of active connection and succeeded average elapsed time, which means the time this call need to wait, and then choose the least one. If there are multiple invokers and the weights are not the same, then random according to the total weight. If there are multiple invokers and the same weight, then randomly called.
Verifying this change
ShotestResponseLoadBalanceTest shows that shortest estimated response invoker or first called invoker or zero active connection invoker will be choosen.
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests=false&mvn clean test-compile failsafe:integration-testto make sure unit-test and integration-test pass.