- Note: Just start learning the linux server performance common index query, reorganize notes, useful websites / blogs will indicate the source.
Server Performance Check Guide
cpu
1.uptime
[root@monitor_outer ~]# uptime 09:43:47 up 27 days, 23:57, 2 users, load average: 0.01, 0.06, 0.01
- Notes
Current server time: 08:21:34
The current server runs 36 min utes
Current number of users 2 users
Current load balancing load average 0.00, 0.00, 0.00, take the mean of 1 min, 5 min and 15 min respectively.
In addition, the average load of the system refers to the average number of processes running in the queue within a specific time interval. (generally less than the number of cpu cores)
2.top
top - 10:20:36 up 28 days, 33 min, 2 users, load average: 0.01, 0.04, 0.00 Tasks: 283 total, 1 running, 282 sleeping, 0 stopped, 0 zombie Cpu(s): 0.7%us, 0.8%sy, 0.0%ni, 98.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 8061760k total, 7858924k used, 202836k free, 552028k buffers Swap: 8388604k total, 16428k used, 8372176k free, 4755172k cached
- Notes
The US column shows the percentage of cpu time spent in user mode. When the value of us is relatively high, it means that the user process consumes more cpu time, but if it is longer than 50%, it is necessary to consider optimizing the user's program.
memory
[root@monitor_outer ~]# vmstat -w 3 100 procs -------------------memory------------------ ---swap-- -----io---- --system-- -----cpu------- r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 17708 161340 552112 4832484 0 0 0 2 2 2 0 0 99 0 0 0 0 17708 160252 552112 4832488 0 0 0 23 726 652 0 0 99 0 0 0 0 17708 160688 552112 4832492 0 0 0 17 859 801 1 1 99 0 0 0 0 17708 160540 552112 4832500 0 0 0 11 868 759 1 1 99 0 0
- r denotes the number of processes running or waiting for CPU time slices in the current run queue, representing that the thread is in a runnable state, but the CPU has not yet been executed. Do not mistakenly think that waiting for CPU time slices means that the process is not running. In fact, one CPU can only occupy one process at a certain time, while the other processes can only wait in a queue. At this time, these processes queuing for CPU resources are still running. If this value is longer than the logical number of CPUs in the system, it indicates that the CPU is insufficient and the number of CPUs needs to be increased.
- In order to facilitate fast reading, the results are briefly sorted out.
free idle physical memory size, si: The size of writing from the swap area to memory per second is transferred from disk to memory. so: The size of memory written to the swap area per second, which is transferred to disk by memory. bi: Number of blocks read per second bo: Number of blocks written per second Wa: Percentage of IO waiting time
In general, if free is very small or falling, si,so,wa is very large, indicating that there is insufficient memory.
disk
root@EM-6CU625XTLL: ~# iostat -x Linux 2.6.32-504.el6.x86_64 (EM-6CU625XTLL) 08/16/2019 _x86_64_ (24 CPU) avg-cpu: %user %nice %system %iowait %steal %idle 4.97 0.00 0.40 0.00 0.00 94.63 Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util sda 0.00 186.16 0.07 5.67 5.23 1534.69 268.12 0.02 4.28 0.16 0.09 dm-0 0.00 0.00 0.07 48.64 4.97 389.14 8.09 0.09 1.72 0.01 0.04
The average time await waits for I/O (milliseconds)
% Percentage of CPU consumed by util by I/O requirements
sysbench
Pressure measuring tool