Simulate high system load
Inject a high system load fault on an ECS instance with Cloud Assistant to test service resilience under stress.
How it works
The ACS-ECS-HighLoad Cloud Assistant plug-in runs the vfork command to create processes that raise the system load to a target value. Each process sleeps until timeout and exits, with minimal impact on system operations.
Procedure
Prerequisites
-
Cloud Assistant Agent is installed on the target ECS instance.
-
Cloud Assistant status is Normal on the instance. See Check Cloud Assistant status and troubleshoot exceptions.
Inject a fault
-
Log on to the ECS instance. See Log on to a Linux instance using Workbench.
-
Run the
ACS-ECS-HighLoadplug-in with sudo privileges:sudo acs-plugin-manager --exec --plugin ACS-ECS-HighLoad --params inject,[num-processes=paramA],[duration=paramB]Optional parameters enclosed in brackets
[]: o-
num-processes: The number of processes to create. Roughly approximates the target system load. Default value: 100.
-
duration: The duration in seconds. Default value: 300.
The following output shows that the
ACS-ECS-HighLoadplug-in runs successfully.
-
-
Verify the fault injection.
-
Run the top command to check the 1-minute, 5-minute, and 15-minute load averages.
-
View the load curve in the Cloud Monitor console.
-
R ecover from the fault
-
Method 1 (recommended): Wait for automatic recovery after timeout.
-
Method 2: Run the recovery command on the ECS instance:
sudo acs-plugin-manager --exec --plugin ACS-ECS-HighLoad --params recover
Example
-
Inject a fault:
sudo acs-plugin-manager --exec --plugin ACS-ECS-HighLoad --params injectThe following output confirms fault injection.

-
Verify the fault injection effect.
-
Run the top command to view load averages. The following figure shows the 1-minute average is 98.33, the 5-minute average is 58.24, and the 15-minute average is 32.66.

-
View load averages in the Cloud Monitor console.

-
-
Recover from the fault:
-
Wait for the load to return to normal after timeout. The following figure shows the 1-minute average dropping below the 5-minute average, indicating recovery.

-
Run the recovery command:
sudo acs-plugin-manager --exec --plugin ACS-ECS-HighLoad --params recover
-