Where:
% User: The percentage of time when the CPU is in user mode.
% Sys: the percentage of time when the CPU is in system mode.
% Iowait: Percentage of CPU waiting for input/output completion time.
Swap in: si, indicating page import of virtual memory, that is, switching from swap disk to RAM
Swap out: so indicates page export of the virtual memory, that is, switching from RAM to swap disk.
(3) system performance analysis tools
1. common system commands
Vmstat, sar, iostat, netstat, free, ps, top, etc.
2. common combination methods
O use vmstat, sar, and iostat to check whether it is a CPU bottleneck.
O use free and vmstat to detect memory bottlenecks
O use iostat to check whether it is a disk I/O bottleneck
O use netstat to check whether it is a network bandwidth bottleneck
(4) Linux performance evaluation and optimization
1. overall system performance evaluation (uptime Command)
[Root @ server ~] # Uptime
16:38:00 up 118 days, 5 users, load average: 1.22, 1.02, 0.91
Note: load average is the output value. The size of these three values cannot be greater than the number of system CPUs. for example, the system has eight CPUs in this output, if the three load average values are greater than 8 for a long time, the CPU is very busy and the load is high, which may affect the system performance, generally, the system performance is not affected. Conversely, if the output value of the load average is smaller than the number of CPUs, it indicates that the CPU still has idle time slice. for example, the output in this example, the CPU is very idle.
2. CPU performance evaluation
(1) monitor the CPU of the system using the vmstat command
This command displays brief information about the performance of various system resources. here we mainly use it to view a CPU load.
The output result of the vmstat command in a system is as follows: