当前位置:网站首页>Cartoon: what is service fusing?
Cartoon: what is service fusing?
2022-07-05 16:09:00 【Small ash】
Xiaohui's answer strategy , It's about thinking when you're in trouble 、 Keep thinking , Until the end of the exam . You can use the following flow chart to show :
Rhubarb's answer strategy , It's about trying to think a few times when you have a problem , If a certain number of attempts fail , Give up decisively , Continue to answer other questions . When other questions are answered , Come back and rethink that puzzle . You can use the following flow chart to show :
What is service fusing ?
The concept of fusing comes from... In electronic engineering Circuit breaker (Circuit Breaker). In the Internet system , When downstream services respond slowly or fail due to heavy access pressure , Upstream services to protect the overall availability of the system , You can temporarily cut off calls to downstream services .
The sacrifice is local , The measure to preserve the whole is called Fuse .
If no fusing measures are taken , What will happen to our system ? Let's see a chestnut .
There are... In the current system A,B,C Three services , service A Is the upstream , service B It's midstream , service C It's downstream . Their call chain is as follows :
Once downstream Services C Becomes unavailable for some reason , There's a huge backlog of requests , service B The request thread of is also blocked . Thread resources are running out , Make service B And it's not available . Then , service A It also becomes unavailable , The whole call link is dragged down .
Cascading failures like this call link , be called An avalanche .
It is the so-called curettage of bone to cure poison , A strong man DuanWan . At a time like this , We need our circuit breaker mechanism to save the whole system . The general process of the circuit breaker mechanism is the same as the examination strategy just mentioned :
Two things need to be explained here :
1. Open fuse
In a fixed time window , Interface call timeout ratio reaches a threshold , Will open the fuse . After entering the fusing state , Subsequent calls to the service interface do not pass through the network , Execute the local default method directly , achieve service degradation The effect of .
2. Fuse recovery
It can't be permanent . After a certain period of time , The service will come back from the fused state , Accept the caller's remote call again .
The practical application of service fusing
Spring Cloud Hystrix Is based on Netflix Open source framework of Hystrix Realization , The framework implements Service failure 、 Thread isolation And a series of service protection functions .
For the realization of the fusing mechanism ,Hystrix Three states are designed :
1. Fuse off state (Closed)
When there is no service failure , Status of fuse , No restrictions on the caller's calls .
2. Fuse on state (Open)
In a fixed time window (Hystrix The default is 10 second ), Interface call error rate reached a threshold (Hystrix The default is 50%), It will enter the fuse on state . After entering the fusing state , Subsequent calls to the service interface do not pass through the network , Direct execution of local fallback Method .
3. Semi fused state (Half-Open)
After entering the fusing open state for a period of time (Hystrix The default is 5 second ), The fuse will be half blown . The so-called half fuse is to try to recover the service call , Allow limited traffic to call the service , And monitor the call success rate . If the success rate is as expected , The service has been restored , Enter the fuse off state ; If the success rate is still very low , Then enter the fusing off state again .
The transformation relationship of the three states is shown in the figure below :
—————END—————
边栏推荐
- 力扣今日题-729. 我的日程安排表 I
- [Netease Yunxin] research and practice of super-resolution technology in the field of real-time audio and video
- 数据湖(十四):Spark与Iceberg整合查询操作
- Li Kou today's question -729 My schedule I
- MySQL table field adjustment
- 机械臂速成小指南(九):正运动学分析
- Five common negotiation strategies of consulting companies and how to safeguard their own interests
- 17. [stm32] use only three wires to drive LCD1602 LCD
- [brief notes] solve the problem of IDE golang code red and error reporting
- Vulnhub-Moneybox
猜你喜欢

具有倍数关系的时钟切换

Replknet: it's not that large convolution is bad, but that convolution is not large enough. 31x31 convolution. Let's have a look at | CVPR 2022

Write a go program with vscode in one article

SQL injection sqllabs (basic challenges) 11-20
![19.[STM32]HC_SR04超声波测距_定时器方式(OLED显示)](/img/fe/8f59db28823290da8e9280df06673d.jpg)
19.[STM32]HC_SR04超声波测距_定时器方式(OLED显示)

【网易云信】超分辨率技术在实时音视频领域的研究与实践

Fundamentals of data communication - Principles of IP routing

降本40%!Redis多租户集群的容器化实践

CISP-PTE之PHP伪协议总结
![18.[STM32]读取DS18B20温度传感器的ROM并实现多点测量温度](/img/e7/4f682814ae899917c8ee981c05edb8.jpg)
18.[STM32]读取DS18B20温度传感器的ROM并实现多点测量温度
随机推荐
Defining strict standards, Intel Evo 3.0 is accelerating the upgrading of the PC industry
Cartoon: what is MapReduce?
Vulnhub-Moneybox
漫画:什么是八皇后问题?
Information collection of penetration test
How difficult is it to pass the certification of Intel Evo 3.0? Yilian technology tells you
Noi / 1.5 37: mercenaries
Background system sending verification code function
OceanBase社区版之OBD方式部署方式本地安装
力扣今日题-729. 我的日程安排表 I
效果编辑器新版上线!3D渲染、加标注、设置动画,这次一个编辑器就够了
定义严苛标准,英特尔Evo 3.0正在加速PC产业升级
The visual experience has been comprehensively upgraded, and Howell group and Intel Evo 3.0 have jointly accelerated the reform of the PC industry
开发中Boolean类型使用遇到的坑
MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
Example project: simple hexapod Walker
21. [STM32] I don't understand the I2C protocol. Dig deep into the sequence diagram to help you write the underlying driver
抽象类和接口的区别
Clock switching with multiple relationship
vlunhub- BoredHackerBlog Social Network