This document describes how to investigate and solve issues such as failure to log in to a Linux CVM due to high CPU and memory usage.
When the Linux CVM has a high CPU load, you may fail to log in.
When the Linux CVM has a high CPU load, you may be able to log in via the console normally.
%CPUcolumn and the
%MEMcolumn and identify which processes consume more resources.
kill PID 23 with signal :appears after you press Enter, press Enter again to keep the default settings.
Send PID 23 signal [15/sigterm]will show up. Press Enter to confirm the termination.
The load average is an indicator of CPU load. A high load average indicates a long queue of processes waiting to run.
top returns very low CPU usage but very high load average as shown below.
Execute the following command to view process states and check whether there is are processes in D state as shown below below:
Processes in D state are in uninterrupted sleep. Processes in the state cannot be terminated nor exit by itself. If there are many processes in D state, you can solve the problem by restoring resources on which the processes depend or restarting the system.
Linux manages memory with the paging mechanism, and it also sets aside a portion of the disk for virtual memory. kswapd0 is the process responsible for page replacement in the virtual memory management of Linux system. When there is not enough system memory, kswapd0 will frequently replace pages, which is very CPU consuming. That is why the process uses a lot of CPU.
Execute the following command and find the kswapd0 process.
Observe the state of the kswapd0 process.
If the process is not sleeping, has run for a long time, and has been using a lot of CPU, please take Step3 to check the memory usage rate.
Execute commands, such as
ps to check how much memory is being used by processes in the system.
Restart the system or terminate the processes that are safe but unnecessary based on the memory usage rate.
If the problem is not solved, please refer to High CPU usage rate (Linux system) for more details.