This is the sixth day of my participation in the August More text Challenge. For details, see: August More Text Challenge
Distributed traffic limiting framework Sentinel traffic control policy
The relational traffic policy is invoked
The call relationship includes the caller and the called, and a method may call other methods, forming a complete call chain. The call relationship traffic policy is controlled by different call dimensions.
- Limit traffic by caller
- Traffic is limited by calling link entry
- Resource flow control with relationships
The caller limits the flow
For flow control based on the request source, you can set the limitApp property to set the source information, which has three options
- Default: does not distinguish between callers. Traffic limiting statistics are performed on any request to access the caller
- Some_origin_name: sets a specific caller. Only requests from the specified caller that are set will receive traffic limiting statistics
- Other: Traffic control is implemented for callers other than some_origin_name
You can configure multiple rules for a resource. If the limitApp Settings for multiple rules are different, the rules take effect in the order of some-origin_name->other->default
Traffic is limited by calling link entry
A current-limiting protection method, may come from different call circuit, such as for A resource, request entry A and B entrance are calling the resources, Sentinel to allow only, according to an entry for current limit for resources, for example, set up in view of the request entry A call will request number statistics, it is similar to the caller to A certain extent the current limit
Associated flow control
When there is a dependency relationship or competition between two resources, the two resources are associated. When the two resources with a dependency relationship are invoked, the execution efficiency of one resource is affected because the operations of the other resource are performed too frequently. Therefore, associated flow control is to limit the execution traffic of one of the resources.
There are several reference indicators for service melt degradation
- Average response time: For example, if 25 requests are entered continuously within 5 seconds and the average response time exceeds the threshold, access to the method will be automatically fuses in the following fixed time window.
- Abnormal ratio: If the proportion of the total number of abnormal calls per second of a method exceeds the threshold, the resource automatically enters the degraded state. In a fixed time window, all calls to the method are automatically fuses.
- Number of exceptions: If the number of exceptions obtained by a method in a specified time window exceeds the threshold, the circuit is automatically broken