Linux iostat Command
The iostat command used to measure the load on the input/output devices with reference to the time the devices are active with respect to the average transfer rates of the devices. It provides the usage of the input/output devices and processor. The reports created by the iostat provides the details to alter the system configurations to maintain the balance of the input/output between physical disks.
Installation of iostat
On RedHat / CentOS / Fedora
# yum install sysstat
On Debian / Ubuntu / Linux Mint
$ sudo apt-get install sysstat
Type iostat in the console.
The reports provide three types of reports such as CPU Utilization report, the Device Utilization report and the Network File system report.
Among that the CPU Utilization report has the following format
Show the percentage of CPU utilization that occurred while executing at the user level (application).
Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
Show the percentage of CPU utilization that occurred while executing at the system level (kernel).
Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
The second section contains device utilization report
Device: device / partition name as listed in /dev directory
tps: show the number of transfers per second that were issued to the device. From the tps value we can determine whether the processor is busy or not. If the tps value is high that means the processor is busy.
Blk_read/s: show the amount of data read from the device expressed in a number of blocks (kilobytes, megabytes) per second
Blk_wrtn/s: show the amount of data written to the device expressed in a number of blocks (kilobytes, megabytes) per second
Blk_read: show the total number of blocks read
Blk_wrtn: show the total number of blocks written
Capture iostat with kilobytes or megabytes
The iostat reports can be displayed in various units of measurements such as in kilobytes or megabytes units. For viewing in kilobytes unit -k parameter can be used and -m parameter to create reports in megabytes’ unit.
$ iostat -k
$ iostat -m
For more detailed report we have -x parameter.
$ iostat -x
Using iostat with delay
Run iostat with kilobytes unit, 3 seconds interval with 2 times reports
$ iostat -m 3 2
Show CPU only report with 2 seconds interval and 4 times reports
$ iostat -c 2 4
The reference of iostat to create reports are:
If you need any further assistance please contact our support department.