dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

adaptive provider flow control and consumer balance algorithm

Open LQLlulu opened this issue 3 years ago • 1 comments

What is the purpose of the change

The P2C with least active load balance algorithm is implemented.

使用方法: 自适应限流部分的使用方法: 要确保服务端存在多个节点,并且消费端开启重试策略的前提下,限流功能才能更好的发挥作用。 设置方法与静态的最大并发值设置类似,只需在provider端将"flowcontrol"设置为"autoConcurrencyLimier"或者"heuristicSmoothingFlowControl"即可。

实验效果 负载均衡部分: image image

自适应限流部分 image

Brief changelog

Verifying this change

Checklist

  • [ ] Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • [ ] Each commit in the pull request should have a meaningful subject line and body.
  • [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • [ ] Add some description to dubbo-website project if you are requesting to add a feature.
  • [ ] GitHub Actions works fine on your own branch.
  • [ ] If this contribution is large, please follow the Software Donation Guide.

LQLlulu avatar Sep 20 '22 01:09 LQLlulu

Codecov Report

Merging #10642 (2c4fd60) into 3.1 (e893407) will increase coverage by 0.03%. The diff coverage is 74.41%.

@@             Coverage Diff              @@
##                3.1   #10642      +/-   ##
============================================
+ Coverage     65.20%   65.24%   +0.03%     
- Complexity      493      494       +1     
============================================
  Files          1336     1338       +2     
  Lines         56932    57018      +86     
  Branches       8438     8451      +13     
============================================
+ Hits          37123    37201      +78     
- Misses        15840    15845       +5     
- Partials       3969     3972       +3     
Impacted Files Coverage Δ
.../cluster/loadbalance/AdaptivePowerOfTwoChoice.java 74.28% <74.28%> (ø)
...r/loadbalance/PowerOfTwoChoiceWithLeastActive.java 75.00% <75.00%> (ø)
...in/java/org/apache/dubbo/common/utils/JVMUtil.java 79.59% <0.00%> (-12.25%) :arrow_down:
...mmon/serialize/fastjson2/FastJson2ObjectInput.java 56.25% <0.00%> (-6.25%) :arrow_down:
...ubbo/registry/client/AbstractServiceDiscovery.java 81.34% <0.00%> (-1.50%) :arrow_down:
...ting/zookeeper/curator/CuratorZookeeperClient.java 69.65% <0.00%> (-0.86%) :arrow_down:
...apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java 62.93% <0.00%> (-0.70%) :arrow_down:
...he/dubbo/registry/zookeeper/ZookeeperRegistry.java 61.05% <0.00%> (-0.53%) :arrow_down:
...rg/apache/dubbo/common/timer/HashedWheelTimer.java 85.56% <0.00%> (-0.35%) :arrow_down:
...n/java/org/apache/dubbo/common/utils/NetUtils.java 62.94% <0.00%> (-0.28%) :arrow_down:
... and 13 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Sep 21 '22 12:09 codecov-commenter