1. Mito
2. Overview
iostat是I/O statistics
(Input / output statistics) is an abbreviation that iostat工具
monitors the system's disk operations. It is characterized by reporting disk activity statistics and also reporting CPU usage. iostat also has a weakness, that is, it cannot analyze a certain process in depth, only analyze the overall situation of the system
3.iostat installation
lostat installation
# iostat属于sysstat软件包。可以直接安装。
yum install sysstat
4. Display all equipment load
[patrickxu@vm1 ~]$ iostat
Linux 2.6.32-279.19.3.el6.ucloud.x86_64 (vm1) 06/11/2017 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.08 0.00 0.06 0.00 0.00 99.86
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
vda 0.45 0.29 8.10 6634946 183036680
vdb 0.12 3.11 30.55 70342034 689955328
Description:
Description of cpu attribute value:
%user:CPU处在用户模式下的时间百分比。
%nice:CPU处在带NICE值的用户模式下的时间百分比。
%system:CPU处在系统模式下的时间百分比。
%iowait:CPU等待输入输出完成时间的百分比。
%steal:管理程序维护另一个虚拟处理器时,虚拟CPU的无意识等待时间百分比。
%idle:CPU空闲时间百分比。
Remarks:
- If the value of% iowait is too high, it indicates that the hard disk has an I / O bottleneck
- If the% idle value is high, the CPU is idle
- If the% idle value is high but the system response is slow, it may be that the CPU is waiting to allocate memory, and the memory capacity should be increased.
- If the% idle value continues to be lower than 10, it indicates that the CPU processing capacity is relatively low, and the most needed resource in the system is the CPU.
Description of cpu attribute value:
tps:该设备每秒的传输次数
kB_read/s:每秒从设备(drive expressed)读取的数据量;
kB_wrtn/s:每秒向设备(drive expressed)写入的数据量;
kB_read: 读取的总数据量;
kB_wrtn:写入的总数量数据量;
Display all information regularly
# 【每隔2秒刷新显示,且显示3次】
iostat 2 3
Display specified disk information
iostat -d /dev/sda
Display tty and CPU information
iostat -t
Display all information in units of M
iostat -m
View device usage (% util), response time (await)
# 【-d 显示磁盘使用情况,-x 显示详细信息】
# d: detail
iostat -d -x -k 1 1
Description:
rrqm/s: 每秒进行 merge 的读操作数目.即 delta(rmerge)/s
wrqm/s: 每秒进行 merge 的写操作数目.即 delta(wmerge)/s
%util: 一秒中有百分之多少的时间用于 I/O
如果%util接近100%,说明产生的I/O请求太多,I/O系统已经满负荷
idle小于70% IO压力就较大了,一般读取速度有较多的wait。
View cpu status
iostat -c 1 1