SpringBoot project current limiting scheme

1. Background

Current limiting is very important for a microservice architecture system, otherwise one of the microservices will become a hidden avalanche factor for the entire system, why do you say that?

For example, a certain SAAS platform has more than 100 microservice applications, but one or several of the underlying applications will be frequently invoked by all upper-level applications. During peak business hours, if the underlying applications are not restricted For stream processing, the application is bound to face tremendous pressure, especially for those interfaces that are called frequently, the most direct performance is that subsequent new incoming requests are blocked, queued, and the response times out... Finally, until the service The JVM resource is exhausted.

2. Overview of current limiting

At the beginning of the design of most microservice architectures, such as in the technology selection stage, architects will plan the combination of technology stacks from a global perspective. For example, should Dubbo be used based on the current product status? Or springcloud? As the underlying framework for microservice governance. Even in order to meet the rapid launch, iteration and delivery, we directly use springboot as the base for development, and then introduce new technology stacks, etc...

Therefore, when talking about specific technical solutions for a certain business scenario, we should not generalize them. Instead, we need to comprehensively evaluate the status quo of products and services. In terms of current limiting, it may not be the same when choosing under the following different technical architectures. Same.

2.1 dubbo service governance model

Choosing the dubbo framework as the basic service governance is good for applications that are biased towards internal platforms. Dubbo uses netty at the bottom layer. Compared with the http protocol, it still has advantages in certain scenarios. If you choose dubbo, you must choose current limiting The following references can be made on the plan.

2.1.1 dubbo frame-level current limiting

Dubbo officially provides comprehensive service management, which can meet the needs of most development scenarios. For the current limiting scenario, it specifically includes the following methods. For specific configuration, you can refer to the official manual;

Client current limit<

Guess you like

Origin blog.csdn.net/WXF_Sir/article/details/131469122