The cpu-usage threshold command sets the alarm threshold and alarm recovery threshold of CPU usage.
The undo cpu-usage threshold command restores the alarm threshold and alarm recovery threshold of CPU usage.
cpu-usage threshold threshold-value [ restore restore-threshold-value ] [ slot slot-id ]
undo cpu-usage threshold [ threshold-value [ restore [ restore-threshold-value ] ] ] [ slot slot-id ]
| Parameter | Description | Value |
|---|---|---|
| threshold threshold-value | Specifies the alarm threshold of CPU usage. When the CPU usage reaches the threshold, the system will generate an alarm. NOTE:
If the device does not transmit traffic or a device with default configuration is used, CPU usage is about 10%. If threshold-value is set too small, for example, less than 10%, the device is overloaded and unable to display clear alarms. Setting threshold-value to greater than 70% is recommended. |
The value is an integer that ranges from 2% to 100%. |
| restore restore-threshold-value | Specifies the alarm recovery threshold of CPU usage. When the CPU usage falls below the threshold, the system will generate a clear alarm. |
The value is an integer ranging from 1% to 99%. This value must be smaller than threshold-value. |
| slot slot-id | Specifies the ID of the slot. | - |
Usage Scenario
By default, the alarm threshold of CPU usage is 80%, and alarm recovery threshold is 75%.
To ensure sufficient CPU resources or enable the device to prompt users with a message indicating insufficient CPU resources, you can run the cpu-usage threshold command to set the alarm threshold and alarm recovery threshold for the CPU usage.
Procedure
When the device is running, you can run the display cpu-usage command to view the threshold for the CPU usage.
Configuration Impact
A log is recorded when CPU usage reaches the configured alarm threshold. When the CPU usage reduces by equal to or smaller than 5% and exceeds the threshold again, no log is recorded. A log is recorded only when the CPU usage reduces by greater than 5% and reaches the threshold again. Log information facilitates tracing the CPU usage.
# Set the threshold of the CPU usage on the main control board to 80%.
<sysname> system-view [sysname] cpu-usage threshold 80
# Set the threshold of the CPU usage on the slot 2 to 80%.
<sysname> system-view [sysname] cpu-usage threshold 80 slot 2
# Set the alarm threshold of CPU usage to 85% and alarm recovery threshold to 80% on the master control board.
<sysname> system-view [sysname] cpu-usage threshold 85 restore 80
# Set the alarm threshold of CPU usage to 85% and alarm recovery threshold to 80% on the slot 2.
<sysname> system-view [sysname] cpu-usage threshold 85 restore 80 slot 2