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

Proposal:Healthy Instance First #337

Closed
CodingSinger opened this issue Jan 22, 2020 · 3 comments
Closed

Proposal:Healthy Instance First #337

CodingSinger opened this issue Jan 22, 2020 · 3 comments

Comments

@CodingSinger
Copy link
Member

CodingSinger commented Jan 22, 2020

背景

在RPC调用中,我们希望尽可能地将请求命中到那些处理能力快、处于健康状态的实例,这里的"健康"可以是我们自己定义的状态,例如错误比例到达某一个阈值时,可以认为不健康。例如某个实例的处理时间高于阈值,则也能认为其不健康。该路由的功能就是通过某种策略断定某个实例不健康,并将其排除在候选调用列表,优先调用那些健康的实例。

效果:

计划在消费侧引入接口级别的两个新配置:

  • healthCheckRoutingEnabled:是否开启优先健康调用。
  • healthRule:健康实例判定策略,允许扩展

以Java注解方式配置示例如下,开启优先健康调用。

   @Reference(version = "1.0.0", parameters = {"healthCheckRoutingEnabled", "true","healthRule", "custom-health-rule"})
   private DemoService demoService;

实现:

  1. 主要在于收集能判断实例健康的依据,这些依据目前主要来自于当前Dubbo富客户端的模型下,客户端能比较轻松统计的一些指标,例如对于某个接口的某个实例的请求总数、错误总数,这些指标的统计可以借助Dubbo中原有的RpcStatus来做。为了支持这个PR,在相关https://github.com/apache/dubbo-go/pull/328中新增了几个统计指标。

@zouyx
Copy link
Member

zouyx commented Jan 22, 2020

我个人觉得问题并不大,但主要是:其中的阈值和某种策略,具体是?

@CodingSinger
Copy link
Member Author

我个人觉得问题并不大,但主要是:其中的阈值和某种策略,具体是?
我们提供默认的策略,比如活跃请求数上限。但是用户也可以自由扩展

@CodingSinger
Copy link
Member Author

之前和陆龟讨论过,也有计划在Java侧做这样的东西,但是后来搁置了。。

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

No branches or pull requests

2 participants