当前位置:网站首页>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
边栏推荐
- TYUT太原理工大学2022软工导论大题汇总
- Excel导入,导出功能实现
- TYUT太原理工大学2022数据库大题之概念模型设计
- 分支语句和循环语句
- Ten minutes to thoroughly master cache breakdown, cache penetration, cache avalanche
- First acquaintance with C language (Part 2)
- Several high-frequency JVM interview questions
- [Chongqing Guangdong education] reference materials for regional analysis and planning of Pingdingshan University
- [algorithm] sword finger offer2 golang interview question 2: binary addition
- Novatel board oem617d configuration step record
猜你喜欢
十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
一文搞定 UDP 和 TCP 高频面试题!
[untitled]
[算法] 劍指offer2 golang 面試題2:二進制加法
服务未正常关闭导致端口被占用
[algorithm] sword finger offer2 golang interview question 9: subarray with product less than k
How to ensure data consistency between MySQL and redis?
【无标题】
2-year experience summary, tell you how to do a good job in project management
The port is occupied because the service is not shut down normally
随机推荐
The earth revolves around the sun
TYUT太原理工大学2022软工导论大题汇总
TYUT太原理工大学2022软工导论简答题
Application architecture of large live broadcast platform
How do architects draw system architecture blueprints?
[algorithm] sword finger offer2 golang interview question 13: sum of numbers of two-dimensional submatrix
TYUT太原理工大学2022软工导论考试题型大纲
TYUT太原理工大学2022数据库大题之概念模型设计
阿里云微服务(三)Sentinel开源流控熔断降级组件
MySQL 三万字精华总结 + 面试100 问,吊打面试官绰绰有余(收藏系列
RTKLIB: demo5 b34f. 1 vs b33
Heap sort [handwritten small root heap]
Employment of cashier [differential constraint]
2022 National Games RE1 baby_ tree
Interview Essentials: talk about the various implementations of distributed locks!
167. Sum of two numbers II - input ordered array - Double pointers
wsl常用命令
Shortest Hamilton path (pressure DP)
几道高频的JVM面试题
PRIDE-PPPAR源码解析