Average load: the average of the system in an operational state and an uninterruptible state within a unit time The number of processes, which is the average number of active processes.
-
Runnable state: a process that is using the cpu or waiting for the cpu, that is, the process whose state is R (Running or Runnable) under the ps command.
-
Uninterruptible state: the process is in the core process of the kernel, these processes are not interruptible, such as waiting for the I/O response of the hardware device, that is, the state under the ps command It is a process of D (Uninterruptible Sleep, also known as Disk Sleep).
-
When the load average is greater than the number of cpu, it indicates that the system has been overloaded. When the load average is higher than 70% of the number of CPUs, it is necessary to troubleshoot the problem of high load. Excessive load will result in slower process response.
-
CPU-intensive processes, using a large number of CPUs will increase the load.
-
I/o intensive process, waiting for I/o will cause the load to increase.
-
Tools
-
stress: Linux system stress test tool
-
sysstat: Linux performance analysis tool, including mpstat and pidstat, etc.
-
mpstat: multi-core cpu performance analysis tool, you can view the performance indicators of each cpu in real time
-
pidstat: process performance analysis tool, you can view the performance of the process cpu, memory, i/o and context in real time Indicator
-
stress –cpu 1 –timeout 600 Simulates the scenario where the CPU usage rate is 100% (- -timeout means execution time)
-
stress -i 1 –timeout 600 Simulate io 100% scene
-
stress- c 8 –timeout 600 Simulate 8 processes
-
mpstat -P ALL 5 1 Display the usage of all cpu, output a set of data in 5 seconds (-P ALL means monitor all Process)
-
pidstat -u 5 1 View the usage of each process, and output a set of data in 5 seconds (-u indicates CPU utilization)
load average
Average load: the average number of processes in a unit of time that the system is in a runnable state and an uninterruptible state, that is, the average active process number.
-
Runnable state: a process that is using the cpu or waiting for the cpu, that is, the process whose state is R (Running or Runnable) under the ps command.
-
Uninterruptible state: the process is in the core process of the kernel, these processes are not interruptible, such as waiting for the I/O response of the hardware device, that is, the state under the ps command It is a process of D (Uninterruptible Sleep, also known as Disk Sleep).
Average load: The average number of processes in a unit time that the system is in an operational state and an uninterruptible state, that is, the average The number of active processes.
Runnable state: the process that is using the cpu or waiting for the cpu, that is, the process whose status is R (Running or Runnable) under the ps command.
Uninterruptible state: Processes that are in the core process of the kernel, these processes are not interruptible, such as waiting for the I/O response of the hardware device, that is, the state under the ps command is D (Uninterruptible Sleep, also Become Disk Sleep) process.
When the load average is greater than the number of cpu, it indicates that the system has been overloaded. When the load average is higher than 70% of the number of CPUs, it is necessary to troubleshoot the problem of high load. Excessive load will result in slower process response.
Several situations where the load increases
For CPU-intensive processes, using a large number of CPUs will cause the load to increase.
i/o intensive process, waiting for i/o will cause the load to increase.
Tools
stress: linux system stress test tool
sysstat: linux performance analysis tool, including mpstat and pidstat, etc.
p>
mpstat: multi-core cpu performance analysis tool, you can view the performance indicators of each cpu in real time
pidstat: process performance analysis tool, you can view the cpu, memory, i/o and context of the process in real time Performance indicators
Command:
stress –cpu 1 –timeout 600 Simulate a scenario where the CPU usage rate is 100% (–timeout means execution time)
stress -i 1 –timeout 600 simulates io 100% scenarios
stress -c 8 –timeout 600 simulates 8 processes
mpstat -P ALL 5 1 shows all cpu Usage, output a set of data in 5 seconds (-P ALL means monitor all processes)
pidstat -u 5 1 View the usage of each process, and output a set of data in 5 seconds (-u means CPU utilization Rate)