Recently, Alibaba middleware team announced open source Sentinel and released the first community version V0.1.0.



Sentinel, as a basic module in alibaba’s “big middle stage and small front stage” architecture, covers all the core scenes of Alibaba, thus accumulating a large number of traffic consolidation scenes and production practices. Sentinel takes flow as the entry point to protect the stability of service from multiple dimensions such as flow control, fusing downgrading and system load protection.

Sentinel open source address: https://github.com/alibaba/Sentinel

Sentinel has the following functions:

➤ current limit:

When we design a function and are ready to go online, this function will consume some resources and the processing limit is 3000 QPS per second. But what should we do if the actual situation is higher than 3000 QPS? Sentinel provides two traffic statistics methods: one is to count the number of concurrent threads, and the other is to count QPS. When the number of concurrent threads exceeds a certain threshold, new requests will be rejected immediately. When the NUMBER of concurrent threads exceeds a certain threshold, the system can respond by direct rejection, cold start, and constant speed. Thus plays the role of flow control.

➤ Circuit breaker downgrade:

Those of you who have worked with Spring Cloud and Service Mesh know the concept of fuse downgrading. For example, service A achieves tens of thousands of QPS per second, but service B cannot achieve tens of thousands of QPS per second at this time. Then, how to ensure that service B can still work normally when service A calls service B frequently? A common situation is that when service A calls service B, the response time of service B is too long due to the failure of service B to meet the requirements of high frequency calls, leading to the response time of service A, which will have A chain reaction affecting all applications on the whole chain of dependencies. In this case, the method of fusing and degrading is needed. Sentinel fuses or degrades services by limiting the number of concurrent threads and degrading resources through response time.

➤ shape

Usually, the flow we encounter has the characteristics of randomness, irregularity and uncontrolled, but the processing capacity of the system is often limited. We need to shape the flow according to the processing capacity of the system, that is, regularization, so as to deal with the flow according to our needs. Sentinel controls the flow through three dimensions of resource invocation relationship, operation index and control effect. Developers can flexibly combine them to achieve the ideal effect.

➤ System load protection

Usually, the system runs smoothly, but in the event of a rush, it is found that the load of the machine is very high. At this time, the load protection of the system is very important to prevent avalanches. Sentinel provides the corresponding protection mechanism to balance the system’s incoming traffic with the system’s load, ensuring that the system can handle the maximum number of requests within its capacity. It should be noted that Sentinel’s judgment mechanism for system load protection is based on the balance between the requests that the system can handle and the requests that are allowed to enter, rather than limiting traffic based on an indirect indicator (system load). The ultimate goal is to increase throughput without dragging the system down, not to load below a certain threshold.

Its features include:

➤ light

Lightweight means less impact on performance and zero intrusion on applications.

The current limiting framework is based on the application, so it is required that the current limiting framework should not consume too much system resources. Just as an airbag in a car is not a good airbag if it consumes fuel and makes the car go slowly, Sentinel access uses very little system resources.

In addition to minimizing the impact on performance, there is another feature that needs to ensure that it has zero intrusion into the application. Zero intrusion means that developers are barely aware of the framework’s existence. It’s exhausting to have developers thinking about downgrading while they’re developing. Good traffic limiting is like the airbag on the car. When the system works normally, we can’t feel its existence. It only appears when the system can’t cope with the current traffic, which is the embodiment of zero intrusion for the application.

Sentinel ADAPTS to mainstream frameworks such as Dubbo, Spring Cloud and GRPC by default. As long as we connect to our adapter, all the default resources are available. If you don’t use a mainstream framework, it doesn’t matter, it’s really easy, like three steps, to plug in, and then there are annotations that make it easier for users to use.

➤ professional

Different scenarios have different traffic limiting requirements. When to reduce the flow rate, when the flow rate decreases more will affect the user experience, when the flow rate decreases will affect the system stability, how to limit the flow rate at steep peak, how to limit the flow rate at peak fill valley, which involves the algorithm of flow limit. Unlike Hystrix, which only provides one or two dimensions of traffic limiting, Sentinel provides a flexible framework that allows developers to tailor their own traffic limiting strategies based on different dimensions.

➤ Real-time monitoring

Traffic is very real-time. Traffic limiting is needed because we cannot accurately predict the arrival of traffic. Otherwise, we can deal with it by elastic computing resources, so the real-time monitoring function of traffic limiting framework is very important. With Sentinel’s real-time monitoring function, operation and maintenance personnel can take different measures according to actual traffic conditions, such as limiting traffic, degrading traffic, shaping, and system protection. Therefore, in the first open source version of Sentinel, we added Sentinel console with real-time monitoring function.

The team also announced that it has donated the Sentinel adaptor to Dubbo, further improving the Dubbo ecosystem. Community address: http://dubbo.incubator.apache.org/#! /blog/sentinel-introduction-for-dubbo.md? lang=zh-cn

If developers access Dubbo Sentinel, real-time second-level monitoring is immediately available. This monitor provides the single-machine link dimension and the single-machine tiling dimension, as well as the summary dimension, which is very convenient.

Source: Alibaba Middleware