How to check the Linux server hard disk I /O read and write load

  

The recent Linux server is abnormal, the system reflects very slowly, the corresponding application can not reflect, but also the situation of crash, after a few days of observation, It is found that the server is under a lot of pressure, and the main pressure comes from the hard disk IO access has reached 100%. In order to facilitate you and yourself to encounter such problems in the future can be resolved as soon as possible, I will look at the linux server hard disk IO access load method to share with everyone:

First, use the top command to view top – 16:15 :05 up 6 days, 6:25, 2 users, load average: 1.45, 1.77, 2.14Tasks: 147 total, 1 running, 146 sleeping, 0 stopped, 0 zombieCpu(s): 0.2% us, 0.2% sy, 0.0 % ni, 86.9% id, 12.6% wa, 0.0% hi, 0.0% siMem: 4037872k total, 4003648k used, 34224k free, 5512k buffersSwap: 7164948k total, 629192k used, 6535756k free, 3511184k cached

View 12.6 % wa

The percentage of CPU time that IO waits for, the IO pressure is higher than 30%

Second, use iostat -x 1 10

If iostat does not, To yum install sysstat

avg-cpu: %user %nice %sys %iowait %idle0.00 0.00 0.25 33.46 66.29

Device: rrqm/s wrqm/sr/sw/s rsec/s wsec/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %utilsda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00sdb 0.00 1122 17.00 9.00 192.00 9216.00 96.00 4608.00 1 23.79 137.23 1033.43 13.17 100.10sdc 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00<<> View %util 100.10 %idle 66.29

If %util is close to 100%, the resulting I/There are too many O requests, the I/O system is full, and the disk may have a bottleneck.

idle less than 70% IO pressure is larger, generally read speed has more wait.

At the same time can be combined with vmstat to view b parameters (number of processes waiting for resources)

vmstat -1

If you want to do an IO load stress test on your hard disk, you can use the following command

time dd if=/dev/zero bs=1M count=2048 of =direct_2G

This command creates a new 2G file in the current directory.

We test the load of IO while creating a new folder

and then view it through the following script. Peak process io situation

Copyright © Windows knowledge All Rights Reserved