spring cloud sentinel

详细参数: https://blog.****.net/weixin_44757206/article/details/107119085?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.edu_weight&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.edu_weight

1.随着微服务的流行,服务和服务之间的稳定性变得越来越重要。Sentinel 以流量为切入点,从流量控制、熔断降级、系统负载保护等多个维度保护服务的稳定性。说白了,就是对SpringCloud Hystrix进一步的优化,大多数是参照Hystrix的核心理念的.

2.

spring cloud sentinel

3.下载安装sentinel:

4.初始化sentinel工程:

5.流控规则:

spring cloud sentinel

spring cloud sentinel

spring cloud sentinel

spring cloud sentinel

6.流量效果:

①快速失败

快速失败: 直接失败,抛异常,默认的流控处理,上述全部是快速失败的例子,就不多说了

②Warm Up

Warm Up: 即预热/冷启动方式。当系统长期处于低水位的情况下,当流量突然增加时,直接把系统拉升到高水位可能瞬间把系统压垮。通过“冷启动”,让通过的流量缓慢增加,在一定时间内逐渐增加到阈值上限,给冷系统一个预热的时间,避免冷系统被压垮
应用场景: 秒杀系统在开启的瞬间,会有很多流量上来,很有可能把系统打死,预热方式就是为了保护系统,可以慢慢的把流量放进来,慢慢的把阈值增长为设置的阈值
公式: 默认coldFactor为3,即请求QPS从设定的阈值/3开始,经预热时长逐渐升至设定的QPS阈值

spring cloud sentinel

spring cloud sentinel

7:.降级规则(RT,异常比例,异常参数):

spring cloud sentinel

spring cloud sentinel

spring cloud sentinel

spring cloud sentinel

8.热点规则:

spring cloud sentinel

spring cloud sentinel

9.热点规则参数例外项:

spring cloud sentinel

10.系统规则:

spring cloud sentinel