The Iostat command is primarily used to monitor CPU and disk IO statistics in Linux systems
Help for this command can be obtained through Iostat--help
[Email protected] ~]$ Iostat--<interval>[<count>-C |-d] [-K |-m] [-t] [-v] [-X ] [-n] [-h][-<device> [...] | ALL] [-P [<device> | ALL]]
From the Help information above you can see the Iostat command can be followed by many parameters, the main parameters are:
-C displays only CPU statistics and cannot be used in conjunction with the-D parameter
-D displays only the statistics of the disk and cannot be used in conjunction with the-c parameter
-K Displays the amount of disk requests per second, in units of a block
-T time to display statistics
-V Print out the version number and help information
-X print out extended information
-p device Name displays statistics for the specified device
-P device All displays statistics for all devices
Iostat-x 5 2 Displays statistics every 5 seconds, showing 2 times
Example:
[Email protected] ~]$ iostat-x5 2Linux2.6. --194. EL5 (STD) ./Geneva/ -avg-CPU:%user%nice%system%iowait%steal%Idle0.09 0.01 0.19 0.88 0.00 98.84DEVICE:RRQM/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz Avgqu-szawaitSvctm%UTILSDA0.05 4.05 0.18 1.57 6.74 45.00 29.60 0.04 25.09 11.38 1.99sda10.04 4.05 0.17 1.57 6.73 45.00 29.60 0.04 25.09 11.38 1.99sda20.00 0.00 0.00 0.00 0.01 0.00 43.22 0.00 3.97 3.27 0.00SDB0.01 0.00 0.00 0.00 0.01 0.00 21.24 0.00 0.32 0.31 0.00SDB10.00 0.00 0.00 0.00 0.00 0.00 17.17 0.00 0.17 0.17 0.00SDC0.01 0.00 0.00 0.00 0.01 0.00 21.24 0.00 0.30 0.28 0.00SDC10.00 0.00 0.00 0.00 0.00 0.00 17.17 0.00 0.04 0.04 0.00avg-CPU:%user%nice%system%iowait%steal%Idle0.10 0.00 0.51 0.61 0.00 98.78DEVICE:RRQM/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz Avgqu-szawaitSvctm%UTILSDA0.00 3.00 0.00 0.80 0.00 30.40 38.00 0.01 14.25 14.25 1.14sda10.00 3.00 0.00 0.80 0.00 30.40 38.00 0.01 14.25 14.25 1.14sda20.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00SDB0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00SDB10.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00SDC0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00SDC10.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
The above parameters are explained:
-----AVG-CPU------
%user percentage of CPU that the user process is running
%nice the percentage of CPU that the nice operation occupies
%system percentage of CPU that the system process is running
%iowait Cup percentage of CPU waiting for hardware IO
%idle free Cup percentage
----Device---------
rrqm/s the number of read requests sent to the device per second after the read-in request is merged
wrqm/s the number of write requests sent to the device per second after the write request is merged
R/S number of Read requests per second sent to the device
W/S number of write requests sent to the device per second
RSEC/S number of sectors read in per second from the device
WSEC/S number of sectors written per second from the device
Avgrq-sz The average size of the request sent to the device, in sectors
Avgqu-sz average queue Length sent to the device
The average execution time of an await IO request, including the time of sending the request and execution, in milliseconds
SVCTM average execution time of IO requests sent to the device in milliseconds
%util percentage of CPU time spent during IO requests being sent to the device (percent of processing IO time as a percentage of total time)
Note: Await can be interpreted as IO response time
%util can be understood as the device's busy level
Iostat Command Learning