TrumanWong

iostat

Monitor system input and output device and CPU usage

Supplementary instructions

iostat command is used to monitor system input and output device and CPU usage. Its feature is to report disk activity statistics and CPU usage. Like vmstat, iostat also has a weakness, that is, it cannot conduct in-depth analysis of a certain process, but only analyzes the overall situation of the system.

grammar

iostat(options)(parameters)

Options

-c: only displays CPU usage;
-d: Only display device utilization;
-k: Display status in kilobytes per second instead of blocks per second;
-m: Display status in megabytes per second;
-p: Only display the status of block devices and all other partitions being used;
-t: Displays the time when each report is generated;
-V: Display the version number and exit;
-x: Display extension status.

Parameters

  • Interval: the interval between each report (seconds);
  • Count: Display the number of times reported.

Example

Use iostat -x /dev/sda1 to view disk I/O details:

iostat -x /dev/sda1
Linux 2.6.18-164.el5xen (localhost.localdomain)
March 26, 2010

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 output by the subsequent I/O, as shown below:

Label Description
Device Monitoring device name
rrqm/s Number of read requests per second
wrqm/s Number of write requests per second
r/s Number of actual read requests per second
w/s Number of actual write requests per second
rsec/s Number of segments read per second
wsec/s Number of segments written per second
rkB/s Actual read size per second, in KB
wkB/s Actual write size per second, in KB
avgrq-sz average size segment required
avgqu-sz average queue length of demand
await Average time to wait for I/O (milliseconds)
svctm Average time to complete I/O requirements
%util Device bandwidth usage, reaching 100% means saturation and reaching a performance bottleneck. If it is a device that supports processing concurrent requests, it does not mean a performance bottleneck.