当前位置:网站首页>Alibaba cloud microservices (III) sentinel open source flow control fuse degradation component
Alibaba cloud microservices (III) sentinel open source flow control fuse degradation component
2022-07-06 13:08:00 【Geometer】
In microservice , Stability has always been an unavoidable topic , A lot of times , You will encounter a large amount of traffic suddenly onto the system, which will make the system unable to carry
For example, Taobao's double 11 promotion may appear
1. The instantaneous peak exceeds the maximum load
2. The surge of traffic broke the system
3. Hot goods crowd out normal traffic
4.CPU Load You can't live high
Possible reasons for unreliable service :
1.RPC Overtime
2. The abnormal proportion is increasing
3. The queue is full
4. Thread pool full
Occasionally, a service hangs up in the micro service
If the service is dragged down and makes itself unavailable, it will drag down other services later , And then lead to avalanches
So for these scenarios of micro service stability , Flow degradation is very important to ensure stability , To solve this problem , There are generally the following measures
1. Current limiting , hold QPS Limit to a certain threshold
2. Traffic shaping , Traffic is random and unpredictable , Many times we need to adjust the flow to the desired shape, such as slowly increasing rather than suddenly increasing
3. Fusing the drop , Avoid being overwhelmed by other services
Services are generally divided into consumer and provider:
stay provider The terminal should carry out current limiting protection , Ensure that it is not overwhelmed by the surge of traffic , In order to ensure provider Normal call of , We can
1. Current limiting protection , Too fast calls are directly rejected
2. Authorized protection , Unauthorized applications will be rejected directly
3. System protection ,load Stop service beyond the threshold
4. Hotspot protection , Enhanced current limiting protection
consumer In order to prevent being dragged down by unstable service calls , When the service call exceeds the time threshold or request quantity , Auto fuse 
Hystrix The main focus is thread pool isolation , The advantage is that the isolation is relatively complete , The disadvantage is that when there are many service calls , It will create a thread pool according to each service call , The thread pool creates a large number of threads , There will be harm of context switching .ThreadLocal There will be problems in the scene , Such as relying on ThreadLocal Carry out the transmission of things or some flags
About Sentinel Start the console first , After the console is started, access it in the browser sentinel In the console 
To configure , Access sentinel

At this time, call the interface 
You can see the call result in the browser , Information can be seen on the console 
Use the console to limit the current of this interface 

Can be found when qps When the set threshold is exceeded , Fuse 

Here's how gateway
See this post for related introduction :
https://www.cnblogs.com/xuweiweiwoaini/p/13858898.html
Configure relevant information in the local project 
hold demo The beginning and httpbin The initial flow is led into different positions of the channel
Call demo Interface 
Can be in foo-service-route see , After several visits, you can find it on the console demo-gateway The application of 
Set parameter current limit in the console 

边栏推荐
- [GNSS] robust estimation (robust estimation) principle and program implementation
- Record: Navicat premium can't connect to MySQL for the first time
- 十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
- Alibaba cloud side: underlying details in concurrent scenarios - pseudo sharing
- 4.30动态内存分配笔记
- 2年经验总结,告诉你如何做好项目管理
- 错误:排序与角标越界
- [算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和
- TYUT太原理工大学2022数据库题库选择题总结
- C code implementation of robust estimation in rtklib's pntpos function (standard single point positioning spp)
猜你喜欢

系统设计学习(三)Design Amazon‘s sales rank by category feature

TYUT太原理工大学2022数据库大题之分解关系模式

Role movement in the first person perspective

MYSQL索引钟B-TREE ,B+TREE ,HASH索引之间的区别和应用场景

Detailed explanation of balanced binary tree is easy to understand

服务未正常关闭导致端口被占用
![[算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和](/img/d5/4bda133498f71ae9fd7a64c6cba8f0.png)
[算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和

染色法判定二分图
![[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity](/img/9d/7284c1399964d3fb48886f12e4941c.jpg)
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity

2年经验总结,告诉你如何做好项目管理
随机推荐
TYUT太原理工大学2022软工导论考试题型大纲
记录:下一不小心写了个递归
一文搞定 UDP 和 TCP 高频面试题!
C code implementation of robust estimation in rtklib's pntpos function (standard single point positioning spp)
Iterable、Collection、List 的常见方法签名以及含义
Detailed explanation of balanced binary tree is easy to understand
微信小程序开发心得
[rtklib] preliminary practice of using robust adaptive Kalman filter under RTK
【无标题】
IText 7 generate PDF summary
阿里云一面:并发场景下的底层细节 - 伪共享问题
TYUT太原理工大学2022数据库大题之概念模型设计
Interview Essentials: talk about the various implementations of distributed locks!
[algorithm] sword finger offer2 golang interview question 2: binary addition
[algorithm] sword finger offer2 golang interview question 13: sum of numbers of two-dimensional submatrix
Code example of MATLAB reading GNSS observation value o file
Record: the solution of MySQL denial of access when CMD starts for the first time
GNSS positioning accuracy index calculation
[算法] 剑指offer2 golang 面试题7:数组中和为0的3个数字
[算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和