当前位置:网站首页>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
边栏推荐
- MySQL 30000 word essence summary + 100 interview questions, hanging the interviewer is more than enough (Collection Series
- [GNSS] robust estimation (robust estimation) principle and program implementation
- Comparative analysis of the execution efficiency of MySQL 5.7 statistical table records
- KF UD decomposition pseudo code implementation advanced [2]
- 堆排序【手写小根堆】
- Experience summary of autumn recruitment of state-owned enterprises
- 《软件测试》习题答案:第一章
- Implementation of Excel import and export functions
- isEmpty 和 isBlank 的用法区别
- RTKLIB: demo5 b34f. 1 vs b33
猜你喜欢
[算法] 剑指offer2 golang 面试题5:单词长度的最大乘积
[算法] 剑指offer2 golang 面试题8:和大于或等于k的最短子数组
【GNSS数据处理】赫尔默特(helmert)方差分量估计解析及代码实现
[algorithm] sword finger offer2 golang interview question 1: integer division
[algorithm] sword finger offer2 golang interview question 2: binary addition
[algorithm] sword finger offer2 golang interview question 5: maximum product of word length
Role movement in the first person perspective
Alibaba cloud side: underlying details in concurrent scenarios - pseudo sharing
[algorithm] sword finger offer2 golang interview question 4: numbers that appear only once
TYUT太原理工大学2022软工导论大题汇总
随机推荐
[Yu Yue education] guide business reference materials of Wuxi Vocational and Technical College of Commerce
面渣逆袭:Redis连环五十二问,三万字+八十图详解。
165. Compare version number - string
TYUT太原理工大学2022“mao gai”必背
IText 7 generate PDF summary
TYUT太原理工大学2022数据库大题之分解关系模式
染色法判定二分图
2-year experience summary, tell you how to do a good job in project management
Dark chain lock (lca+ difference on tree)
继承和多态(上)
[algorithm] sword finger offer2 golang interview question 10: subarray with sum K
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
微信小程序开发心得
[算法] 剑指offer2 golang 面试题2:二进制加法
Error: symbol not found
Record: I accidentally wrote a recursion next time
[算法] 剑指offer2 golang 面试题13:二维子矩阵的数字之和
WSL common commands
TYUT太原理工大学2022数据库大题之概念模型设计
167. Sum of two numbers II - input ordered array - Double pointers