You can use adaptive throttling or manually configure a system rule to control application traffic. Adaptive throttling dynamically adjusts your application's ingress traffic based on CPU usage. A system rule controls traffic at the application level by using a combination of system metrics. Both methods aim to balance ingress traffic with the system's load, ensuring stable operation at maximum throughput.
Prerequisites
Your application is connected to AHAS Application Protection. For instructions, see Connect an application.
Background information
- Adaptive throttling: When enabled, the system dynamically adjusts your application's ingress traffic based on CPU usage. This feature helps maintain system stability under high load while maximizing throughput.
- System rule: If you disable adaptive throttling, you must manually configure a system rule. A system rule controls ingress traffic at the application level. It uses metrics such as system load, CPU usage, average RT, ingress QPS, and concurrent threads to balance traffic and load. This ensures your system runs stably at maximum throughput.
A system protection rule applies at the application level, not at the resource level, and affects only ingress traffic. Ingress traffic is any traffic that enters your application, such as requests received by a web service or a Dubbo provider. For applications integrated by using custom instrumentation or annotations, ingress traffic is generated when EntryType.IN logic is invoked. You must configure a system rule for ingress traffic. By default, the rule affects only Dubbo or HSF interfaces, such as the default instrumentations for Dubbo and Servlet. You can also apply a system rule to a specific method by modifying it with EntryType.IN. For more information about EntryType.IN, see Use custom instrumentation and Integrate Spring applications.
- Load (for Linux and Unix-like systems only): Triggers protection when the system's 1-minute load average exceeds the threshold and the current number of concurrent threads surpasses the system's capacity.
- CPU usage: Triggers protection when the system CPU usage exceeds the specified threshold (0.0 to 1.0).
- RT: Triggers protection when the average RT of all ingress traffic on a single machine reaches the threshold.
- Thread count: Triggers protection when the concurrent thread count for all ingress traffic on a single machine reaches the threshold.
- Ingress QPS: Triggers protection when the QPS of all ingress traffic on a single machine reaches the threshold.
You can configure only one system protection rule of each type for an application. This means you can configure a maximum of five system protection rules for a single application. To learn about the principles behind configuring a system rule, see System protection.
Create a system rule
Log on to the AHAS console.
In the upper-left corner of the AHAS console, select the region where your application is deployed.
In the left-side navigation pane, choose .
On the application protection page, click your target application's card on the application card tab.
- In the left-side navigation pane, click rule management, and then click the adaptive throttling tab.
- In the upper-left corner of the page, turn off the adaptive throttling switch. In the dialog box that appears, click Disable.
- In the upper-right corner of the adaptive throttling tab, click New system protection rule.
- In the New system protection rule dialog box, configure the parameters for the rule.
Parameter Description Usage scenarios CPU usage Triggers protection when the system CPU usage exceeds the threshold. The valid range is 0.0 to 1.0, which corresponds to 0% to 100%. Ideal for setting a resource usage baseline to maintain a safety margin. Set a moderate threshold to leave a buffer for system operations. Load Triggers protection only when the system's 1-minute load average exceeds the threshold and the current concurrent thread count surpasses the system's capacity. System capacity is calculated as maxQps × minRt. Ideal for setting a resource usage baseline to maintain a safety margin. Set a moderate threshold to leave a buffer for system operations. Thread count Triggers protection when the concurrent thread count for all ingress traffic on a single machine reaches the threshold. Ideal for setting a resource usage baseline to maintain a safety margin. Set a moderate threshold to leave a buffer for system operations. Average ingress RT Triggers protection when the average RT of all ingress traffic on a single machine reaches the threshold. The unit is milliseconds (ms). Suitable for measuring the performance of incoming requests. Total ingress QPS Triggers protection when the QPS of all ingress traffic on a single machine reaches the threshold. Suitable for measuring the volume of incoming requests. - Click Create.