4 0.00 4.96 4.88 0.01
sda 1.22 0.48 1.13 0.56 0.03 0.00 41.66 0.01 6.83 5.27 0.89
[root@localhost ~]# iostat -d -m -x 2 3
Linux 2.6.32-504.el6.i686 (localhost.localdomain) 10/09/2015 _i686_ (1 CPU)
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
scd0 0.02 0.00 0.01 0.00 0.00 0.00 10.94 0.00 4.96 4.88 0.01
sda 1.19 0.48 1.10 0.55 0.03 0.00 41.52 0.01 6.81 5.25 0.87
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
scd0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
scd0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda 0.00 0.00 0.00 0.51 0.00 0.00 8.00 0.00 3.00 3.00 0.15
[root@localhost ~]# iostat -y -d -m -x 2 3
Linux 2.6.32-504.el6.i686 (localhost.localdomain) 10/09/2015 _i686_ (1 CPU)
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
scd0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
scd0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
scd0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
?
?
字段含义:
?
Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn 分别表示:每秒读取block的个数,每秒写block的个数,总共读了多少个block,总共写了多少个block
?
tps: Indicate the number of transfers per second that were issued to the device. A transfer is an I/O request to the device. Multiple logical requests can be combined into a single I/O request to the device. A transfer is of indeterminate size.(就是对磁盘每秒请求多少次IO操作)
?
rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
?
rrqm/s wrqm/s 表示的磁盘读和写时每秒发生多少次相邻磁盘的merge操作;rrqm: read request merge; wrqm:write request merge
?
r/s w/s 表示每秒读的次数,写的次数;
?
rMB/s wMB/s 表示每秒读多少MB,写多少MB
?
avgrq-sz:The average size (in sectors) of the requests that were issued to the device. 平均一个IO请求涉及到多少个sector
?
avgqu-sz:The average queue length of the requests that were issued to the device. IO队列的平均长度,该数值很重要。
?
await:The average time (in milliseconds) for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.平均每一个IO花费了多少毫秒(包括在IO队列中的排队时间和读写操作花费的时间)。这里可以理解为IO的响应时间,一般地系统IO响应时间应该低于5ms,如果大于10ms就比较大了。
?
svctm:弃用
?
%util :Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%. 在统计时间内所有处理IO时间,除以总共统计时间。例如,如果统计间隔1秒,该设备有0.8秒在处理IO,而0.2秒闲置,那么该设备 的%util = 0.8/1 = 80%,所以该参数暗示了设备的繁忙程度。一般地,如果该参数是100%表示设备已经接近满负荷运行了(当然如果是多磁盘,即使%util是100%,因 为磁盘的并发能力,所以磁盘使用未必就到了瓶颈)。
?
CPU的 %iowait io等待很高;
?
磁盘的 avgqu-sz数值很大;await数值很高;%util数值很高;都可能预示着磁盘存在瓶颈或者磁盘出现问题或者故障。
?
2.2 使用 iostat 查看磁盘每个分区的IO
?
上面查看的都是整个磁盘的IO情况,下面的命令可以查看具体某个磁盘的所有分区的IO情况:
?
?
[root@localhost ~]# iostat -x -d -m -p sda 2 3
Linux 2.6.32-504.el6.i686 (localhost.localdomain) 10/09/2015 _i686_ (1 CPU)
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %u