iostat
Monitor the usage of system input and output devices and CPU
Recommended Linux command online tool: linux online query tool
Supplementary Note
The iostat command is used to monitor system input and output devices and CPU usage. It is characterized by reporting disk activity statistics and also reporting CPU usage. Like vmstat, iostat also has a weakness, that is, it cannot conduct an in-depth analysis of a certain process, but only analyzes the overall situation of the system.
grammar
iostat(选项)(参数)
options
-c:仅显示CPU使用情况;
-d:仅显示设备利用率;
-k:显示状态以千字节每秒为单位,而不使用块每秒;
-m:显示状态以兆字节每秒为单位;
-p:仅显示块设备和所有被使用的其他分区的状态;
-t:显示每个报告产生时的时间;
-V:显示版号并退出;
-x:显示扩展状态。
parameter
- Interval time: the interval time (seconds) of each report;
- Times: Displays the number of times reported.
example
Used toiostat -x /dev/sda1
view the details of disk I/O:
iostat -x /dev/sda1
Linux 2.6.18-164.el5xen (localhost.localdomain)
2010年03月26日
avg-cpu: %user %nice %system %iowait
%steal %idle
0.11 0.02 0.18 0.35
0.03 99.31
Device: tps Blk_read/s Blk_wrtn/s
Blk_read Blk_wrtn
sda1 0.02 0.08
0.00 2014 4
Detailed description: the second line is the system information and monitoring time, the third and fourth lines show the CPU usage (the specific content is the same as the mpstat command). Here we mainly focus on the information of the subsequent I/O output, as shown below:
marked | illustrate |
---|---|
Device | Monitoring device name |
rrqm/s | The number of requests that need to be read per second |
wrqm/s | The number of requests that need to be written per second |
r/s | The number of actual read requests per second |
w/s | The number of actual write requests per second |
rsec/s | Number of read segments per second |
wsec/s | Number of segments written per second |
rkB/s | The actual read size per second, in KB |
wkB/s | The size actually written per second, in KB |
avgrq no | Average size segment required |
avgqu no | Average queue length for demand |
await | Average waiting time for I/O (milliseconds) |
svctm | Average time to complete I/O requests |
%util | Percentage of CPU consumed by I/O requests |