当前位置:网站首页>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 

边栏推荐
- [算法] 剑指offer2 golang 面试题7:数组中和为0的3个数字
- [algorithm] sword finger offer2 golang interview question 2: binary addition
- [dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
- 初识C语言(下)
- isEmpty 和 isBlank 的用法区别
- Several high-frequency JVM interview questions
- [algorithm] sword finger offer2 golang interview question 3: the number of 1 in the binary form of the first n numbers
- [算法] 剑指offer2 golang 面试题9:乘积小于k的子数组
- 《软件测试》习题答案:第一章
- TYUT太原理工大学2022软工导论简答题
猜你喜欢

TYUT太原理工大学2022数据库大题之数据库操作

2022 National Games RE1 baby_ tree

The earth revolves around the sun

阿里云微服务(二) 分布式服务配置中心以及Nacos的使用场景及实现介绍

Iterable、Collection、List 的常见方法签名以及含义

Dark chain lock (lca+ difference on tree)

rtklib单点定位spp使用抗差估计遇到的问题及解决

How to ensure data consistency between MySQL and redis?

On March 15, the official version of go 1.18 was released to learn about the latest features and usage
![[算法] 劍指offer2 golang 面試題2:二進制加法](/img/c2/6f6c3bd4d70252ba73addad6a3a9c1.png)
[算法] 劍指offer2 golang 面試題2:二進制加法
随机推荐
【快趁你舍友打游戏,来看道题吧】
Tyut Taiyuan University of technology 2022 introduction to software engineering examination question outline
One article to get UDP and TCP high-frequency interview questions!
异常:IOException:Stream Closed
TYUT太原理工大学2022软工导论简答题
分支语句和循环语句
Abstract classes and interfaces
MySQL shutdown is slow
Tyut Taiyuan University of technology 2022 introduction to software engineering
167. Sum of two numbers II - input ordered array - Double pointers
Record: the solution of MySQL denial of access when CMD starts for the first time
《软件测试》习题答案:第一章
MYSQL索引钟B-TREE ,B+TREE ,HASH索引之间的区别和应用场景
Experience summary of autumn recruitment of state-owned enterprises
Sharing ideas of on-chip transplantation based on rtklib source code
Iterable、Collection、List 的常见方法签名以及含义
继承和多态(下)
基本Dos命令
165. Compare version number - string
Music playback (toggle & playerprefs)