xiaobaicai66695 commented on PR #1555: URL: https://github.com/apache/dubbo-admin/pull/1555#issuecomment-6896358568
亲和性路由因为是dubbo最新的3.3.6版本的新增的功能[dubbo 3.3.6 release note](https://github.com/apache/dubbo/releases/tag/dubbo-3.3.6),dubbo官网上没有更新,下边解释一下测试用的yaml ``` yaml configVersion: v3.1 scope: service key: "org.apache.dubbo.samples.CommentService::" runtime: true enabled: true affinityAware: key: region ratio: 1 ``` ratio 的判定逻辑基于一个实时计算的比例: 当前可用比例 = (满足亲和条件的实例数 / 集群总可用实例数) × 100 在配置中 ratio: 1,其行为可以解读为: 正常工作:只要与消费者同 region 的提供者实例占比 大于 1%,Dubbo 就会优先将请求路由到这些“亲和的”实例上。 触发降级:如果因故障等原因,同 region 的可用实例占比下降到 ≤ 1%,亲和路由会认为继续只访问这些实例风险过高,从而自动降级,将请求路由回所有可用实例,以保证服务的整体可用性。 ratio 是 Dubbo 亲和路由中一个用于控制“就近访问”降级行为的百分比阈值。它的核心作用是:当满足亲和条件(如同 region)的提供者实例数量,在总实例数中占比过低时,为了避免因少数节点故障导致流量拥塞,自动降级为访问全部实例。 以下是亲和路由的端到端测试的demo: https://github.com/user-attachments/assets/2775ffe8-65d4-4af4-bccd-4ac98bd01407 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
