当前位置:网站首页>[micro service sentinel] degradation rules slow call proportion abnormal proportion abnormal constant

[micro service sentinel] degradation rules slow call proportion abnormal proportion abnormal constant

2022-06-27 02:19:00 Bulst


Fusing degradation rules (DegradeRule) It contains the following important properties :
 Insert picture description here

Slow call ratio

Slow call ratio (SLOW_REQUEST_RATIO): Select slow call ratio as the threshold , You need to set the slow call allowed RT( The maximum response time ), If the response time of the request is greater than this value, it is counted as a slow call . When the unit counts time (statIntervalMs) The number of internal requests is greater than the set minimum number of requests , And the proportion of slow calls is greater than the threshold , Then the next request will be automatically fused within the duration of fusing . After fusing for a long time, the fuse will enter the detection recovery state (HALF-OPEN state ), If the next request response time is less than the set slow call RT Then it ends , If it is greater than the set slow call RT It will be fused again .

 Insert picture description here

  • Maximum RT: Slow call critical RT, Exceeding this value counts as a slow call . Unit millisecond
  • Scale threshold :RT Threshold value of slow request ratio in mode . Default 1.0
  • Duration of fusing : Recovery timeout when circuit breaker is open ( In seconds ). After a timeout , The circuit breaker will switch to the half open state to try some requests . Unit second , The figure shows that after triggering fusing , Next 10 The request will be automatically blown within seconds , after 10S After, the fuse will enter the detection recovery state (HALF-OPEN state ), If the next request response time is less than the set slow call RT Then it ends , If it is greater than the set slow call RT It will be fused again .
  • Minimum number of requests : The minimum number of requests that can trigger a fusing interrupt ( Within the valid statistical time range ). The default value is 5
  • StatIntervalMs: Statistics duration ( Unit is ms), Such as 601000 Represents the minute level (1.8.0 introduce ), Default 1000.
  • Use Jmeter The pressure measuring tool accesses the test interface , Check the current limiting effect drawing , The specific current limiting process is about
    (1) Request to enter the background ,sentinel According to the set statistical duration ( Default 1S) Count the total number of requests in the time period
    (2) First, judge whether the total number of requests counted is less than the minimum number of requests set by the user ( Default 5), If it is less than, it will not fuse , Instead, go to the next step
    (3) Then, according to the maximum value set by the user RT, Judge whether the request in the statistics is a slow call , If it is greater than the setting value, it is a slow call request
    (4) Calculate the slow call request again / Percentage of total statistical requests , Whether the set proportional threshold is exceeded .
    (5) When the number of requests and slow call proportion threshold in the statistical time exceed the set threshold , The request will be automatically blown in the next fusing duration
    (6) At the end of the fusing period , The fuse will enter the detection recovery state (HALF-OPEN state ), If the next request response time is less than the set slow call RT Then it ends , If it is greater than the set slow call RT It will be fused again .

Abnormal proportion

Abnormal proportion (ERROR_RATIO): When the unit counts time (statIntervalMs) The number of internal requests is greater than the set minimum number of requests , And the proportion of anomalies is greater than the threshold , Then the next request will be automatically fused within the duration of fusing . After fusing for a long time, the fuse will enter the detection recovery state (HALF-OPEN state ), If the next request is successful ( There is no mistake ) Then it ends , Otherwise, it will be fused again . The threshold range for the exception ratio is [0.0, 1.0], representative 0% - 100%.

 Insert picture description here

Number of abnormal

Number of abnormal (ERROR_COUNT): When the number of exceptions in the unit statistics time exceeds the threshold, it will automatically fuse . After fusing for a long time, the fuse will enter the detection recovery state (HALF-OPEN state ), If the next request is successful ( There is no mistake ) Then it ends , Otherwise, it will be fused again .

 Insert picture description here

原网站

版权声明
本文为[Bulst]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206270157312172.html