[FEATURE] Migrate and Enhance Adaptive Service Throttling in dubbo-go - #3347
nagisa-kunhah wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3347 +/- ##
===========================================
+ Coverage 46.76% 55.11% +8.34%
===========================================
Files 295 486 +191
Lines 17172 39951 +22779
===========================================
+ Hits 8031 22019 +13988
- Misses 8287 16218 +7931
- Partials 854 1714 +860 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@Alanxtl hello,也麻烦看下,pr description里有说到,我测rtt_shrink这个case的时候发现,当延迟升高的时候(20ms升高到100ms,再升高到500ms),limiter对inflight的限制似乎并没有明显的减少,而是维持在原来的水平,不清楚这个是否符合原来的预期?测试用的代码放在presee_test/adaptive_service/rtt_shrink下。 |
这更像是暴露了当前 HillClimbing 实现的“不敏感/参数问题”,不太应该当成完全符合预期。 代码原因大概在这里:
这个可能是已知限制。预期上 adaptive concurrency 应该在 RTT 明显恶化、吞吐不再提升时收缩;但当前算法受历史 best metrics、硬编码阈值、update interval 和 shrink 幅度影响,在 另外uber的那个实现太过于复杂了,参考一下就行,不用实现 |
|
|
hi @nagisa-kunhah , still working on this? |
Hi @Alanxtl , thanks for your reminder. I will update it this week. |
|
Hi @Alanxtl , 我简单整理了一下,对当前 dubbo-go 里 Adaptive Service Throttling 相关代码做了一轮梳理。 因为各个模块联系还比较大,我就以server和client两边为分界梳理了两个文档:
目前文档里主要覆盖了这些内容:
关于迁移到 建议迁移到
这些模块迁到 extensions 后,extensions 可以提供一个聚合 imports 包,例如: import (
_ "github.com/apache/dubbo-go-extensions/imports/adaptivesvc"
)这个 imports 包负责 blank import 上面的实现模块,把这些实现注册到 extension registry:
建议继续留在 dubbo-go core 的部分:
需要调整的是注册入口: import (
_ "dubbo.apache.org/dubbo-go/v3/imports"
_ "github.com/apache/dubbo-go-extensions/imports/adaptivesvc"
)这样 core 继续负责配置和 key,extensions 负责实现和注册,用户侧通过 imports 提供可被配置引用的实现。 另外,提到的优化,我们可以在迁移过程中进行优化和测试,下周可以开始迁移。 |
|
@nagisa-kunhah hello, do u have time to complete this task? |
@AlexStocks ok, this pr is just to upload the pressure tests. The rest of work will progress on dubbo-go-extensions repo. |
so many file conflictions. |
0ff6931 to
1f91ae5
Compare
1f91ae5 to
1982c6b
Compare
|



Description
Fixes #3336
Progress:
Pressure tests
Test scenario
samples/adaptive_service/protect_provider/{server,client}: verifies provider protection under high client concurrency by tracking rejects and server-side max active requests.samples/adaptive_service/rtt_shrink/{server,client}: verifies limiter behavior across fast/medium/slow RTT stages and records limitation/remaining/inflight changes.samples/adaptive_service/p2c_healthy/{server,client}: verifies multi-provider adaptive P2C routing by comparing per-provider hit ratio and remaining capacity.Test results
✅ protect_provider:
failed=0, reject rate was about 91%. The provider business handler only processed about 21,020 requests, and rejected requests did not enter the handler.fast:20ms:30s, medium:100ms:20s, slow:500ms:40s, 90s duration.failed=0throughout the run. The limiter was found and reported continuously by the provider stats endpoint. During the fast phase,limiter_limitationgrew from about 55 to a peak of about 123. However, after RTT increased to the 500ms slow phase,limiter_limitationstayed around 122 and did not drop meaningfully below the fast-phase peak. Rejections increased continuously under the high offered load, reaching about 888,000 total rejects by the end of the run.✅ p2c_healthy:
fast=20ms,medium=100ms,slow=300ms; 200 client concurrency; 90s duration; adaptive cluster + P2C load balancing enabled.fast=44%,medium=54%, andslow=1.8%, withfailed=0. The slow provider's interval traffic dropped to 0 later in the test. The medium provider was repeatedly selected as the healthiest node because its reportedremainingcapacity was higher; it reachedlimiter_limitation=500, while the fast provider stayed around 200.Checklist
develop