Iostat
IostatOutputs statistics related to CPU and disk I/O.
Command Format:
Iostat[-C |-D] [-k |-M] [-T] [-V] [-x] [device [...] | all] [-P [device | all]
[Interval [count]
1) Iostat Easy to use
IostatDisplays the load and partition status information of the CPU and I/O systems.
Direct executionIostatThe following content is displayed:
#Iostat
Linux 2.6.9-8.11.eval (ts3-150.ts.cn.tlan) 08/08/2007
AVG-CPU: % USER % nice % sys % iowait % idle
12.01 0.00 2.15 2.30 83.54
Device: TPS blk_read/sBlk_wrtn/S blk_readBlk_wrtn
Hda 7.13 200.12 34.73 640119 111076
The meanings of each output project are as follows:
AVG-CPU segment:
% USER: the percentage of CPU used for running at the user level.
% Nice: the percentage of CPU used by the Nice operation.
% SYS: Percentage of CPU used to run at the system level (kernel.
% Iowait: CPU usage when the CPU waits for hardware I/O.
% Idle: Percentage of idle CPU time.
Device segment:
TPS: the number of I/O requests sent per second.
Blk_read/S: number of blocks read per second.
Blk_wrtn/S: number of blocks written per second.
Blk_read: Total number of read blocks.
Blk_wrtn: Total number of blocks written.
2) Iostat Parameter description
IostatParameters:
-C only displays CPU statistics. It is mutually exclusive with the-D option.
-D only displays the disk statistics. It is mutually exclusive with the-C option.
-K indicates the number of disk requests per second in K. The default unit is block.
-P device | all
This parameter is mutually exclusive with the-x option. It is used to display the statistics of Block devices and system partitions. You can also specify a device name after-P, for example:
#Iostat-P hda
Or display all devices
#Iostat-P all
-T print the data collection time when outputting data.
-V: print the version number and help information.
-X output extension information.
3) Iostat Input Project Description
Blk_read
The total number of read blocks.
Blk_wrtn
The total number of write blocks.
Kb_read/s
The amount of data read from the drive per second. The unit is K.
Kb_wrtn/s
Data volume written to the drive per second, in K.
Kb_read
Total amount of data read, in K.
Kb_wrtn
Total amount of data written, in K.
Rrqm/s
The number of read requests sent to the device per second after the read requests are merged.
Wrqm/s
Number of write requests sent to the device per second after the write requests are merged.
R/S
The number of read requests sent to the device per second.
W/s
Number of write requests sent to the device per second.
Rsec/s
Number of Sectors Read from the device per second.
Wsec/s
Number of sectors written to the device per second.
RKb/s
The amount of data read from the device per second. The unit is K.
WKB/s
Data volume written to the device per second, in K.
Avgrq-SZ
The average size of the request sent to the device. Unit: slice.
Avgqu-SZ
The average queue length of the request sent to the device.
Await
Average execution time of I/O requests, including the time for sending and executing requests. Unit: milliseconds.
Svctm
The average execution time of the I/O requests sent to the device. The unit is milliseconds.
% Util
The percentage of CPU usage during which I/O requests are sent to the device. It is used to display the bandwidth usage of the device.
When the value is close to 100%, the bandwidth of the device is full.
4) Iostat Example
#Iostat
Displays a statistical record, including all CPUs and devices.
#Iostat-D 2
The device statistics are displayed every 2 seconds.
#Iostat-D 2 6
Device statistics are displayed every 2 seconds. A total of 6 device statistics are output.
#Iostat-X hda HDB 2 6
The extended statistics of hda and HDB devices are displayed every two seconds, with a total output of six times.
#Iostat-P sda 2 6
The SDA and the statistics of all the above partitions are displayed every 2 seconds. A total of 6 times are output.