Hystrix熔断机制三个参数解释

The precise way that the circuit opening and closing occurs is as follows:
Assuming the volume across a circuit meets a certain threshold : HystrixCommandProperties.circuitBreakerRequestVolumeThreshold()
And assuming that the error percentage, as defined above exceeds the error percentage defined in : HystrixCommandProperties.circuitBreakerErrorThresholdPercentage()
Then the circuit-breaker transitions from CLOSED to OPEN.
While it is open, it short-circuits all requests made against that circuit-breaker.
After some amount of time (HystrixCommandProperties.circuitBreakerSleepWindowInMilliseconds()), the next request is let through. If it fails, the command stays OPEN for the sleep window. If it succeeds, it transitions to CLOSED and the logic in 1) takes over again.
link

HystrixCommandProperties.circuitBreakerRequestVolumeThreshold()

断路器请求次数阈

HystrixCommandProperties.circuitBreakerErrorThresholdPercentage()

断路器错误百分比阈值

HystrixCommandProperties.circuitBreakerSleepWindowInMilliseconds()

断路器休眠时间窗口

举例:

请求阈值为10;错误百分比为60;休眠时间窗口为5000毫秒;

在窗口时间内,请求次数超过10,且请求的错误次数百分比大于60%,则开启断路器熔断;持续5秒后,Hystrix向目标服务器发送询问请求,若成功则恢复,若失败则继续休眠5秒,重复上述操作;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

垂子帘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值