In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what is the concept of server degradation, circuit breaker and current limit". In daily operation, I believe that many people have doubts about the concept of server degradation, circuit breaker and current restriction. I have consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what is the concept of server degradation, circuit breaker and current limit". Next, please follow the editor to study!
When the number of visits to our system suddenly soars and a large number of requests come in, the most typical is the second-kill business. We may know that there will be a peak. What should we do at this time?
And now in many cases we still need to call third-party interfaces such as payment, so we also have to consider how our system should handle if there is a problem with the third party and the return is abnormal slowly.
There are three common treatment methods: degradation, melting break and current restriction.
Downgrade
Downgrade is service downgrade, when the pressure on our server increases sharply in order to ensure the availability of core functions, selectively reduce the availability of some features, or turn off the feature directly. This is a typical lost car to protect handsome. For example, for post bar type websites, when the server is unable to handle it, you can choose to turn off the posting function, the registration function, the password change, and the profile picture, in order to ensure the core function of logging in and browsing posts.
Generally speaking, an independent downgrade system is established, which can configure the downgrade function of the server flexibly and in batches. Of course, there are also automatic downgrades with code, such as interface timeout demotion, failed retry many times, and so on. The specific number of failures and how long the overtime is set are determined by other factors such as your business. Have a short meeting, set a value, and throw it online to see what's going on. Adjust it according to the situation.
Fuse break
Downgrade generally refers to a downgrade due to a failure of our own system. The circuit breaker generally refers to the failure of the dependent external interface to cut off the relationship with the external interface.
For example, a function in your A service depends on B service. At this time, B service goes wrong and returns slowly. This situation may slow down all the functions in the A service because of such a function, so we need a circuit breaker at this time! That is, when it is found that A wants to call this B, it will directly return an error (or return other default values, etc.), and will not request B.
I still cited two service calls, some of which are really link-by-link, if something goes wrong, it will really be an avalanche.
Of course, some people think that a circuit breaker is not a kind of demotion, and I think I can't refute it if you have to say that a circuit breaker is also a kind of demotion, but there are some differences between their essential prominence and what they want to express.
Then when is the right time to break? That is, which threshold is reached to make a circuit breaker, and 50% of the requests in 5 minutes are more than 1 second? Or what? Reference downgrade.
Current limit
We have accepted the two requests mentioned above, and the current limit is even more ruthless. Say sorry and goodbye to the request directly! That is, how much the system can bear, only so many requests are allowed to come, and other requests say goodbye.
The indicators of general restrictions are: the total number of requests or the total number of requests within a certain period of time.
Total number of requests: for example, if you kill 100 products in a second, I will put 5000 people in, and more than directly reject the request.
Total number of requests within a certain period of time: for example, it is specified that the peak value of requests per second is 1W, and more requests within this second are rejected directly. I'll see you the next second.
At this point, the study of "what is the concept of server degradation, circuit breaker and current restriction" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.