iostat Command: Tutorial & Examples

Display information about the current I/O performance

The iostat command is a utility that is used to display real-time information about the system's input/output (I/O) performance. It shows statistics about the system's CPU usage, as well as the activity of the system's disks and other block devices.

To start iostat, simply type iostat at the command prompt. By default, iostat updates the display every few seconds and shows the average I/O statistics for the entire system.

iostat

Here is an example of the iostat command's output:

Linux 5.10.0-16-amd64 (cleveruptime.com)       12/19/2022      _x86_64_        (16 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
16.50    0.00    4.93    0.11    0.00   78.45

Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
dm-0             66.82      2365.13      4266.45         0.00 30690654721 55362915136          0
dm-1              0.27         0.37         0.73         0.00     4842628     9515140          0
md2               0.00         0.01         0.00         0.20       86278          12    2587576
md3               0.27         0.38         0.73         0.00     4938407     9515140          0
md4               8.22        10.27       107.42        21.12  133278453   1393948360  274102992
md5              69.68      2366.66      4263.93         0.00 30710622477 55330103716          0
nvme0n1          71.04      2300.32      4371.89        15.92 29849685383 56731142126  206616204
nvme1n1          45.55       797.20      4371.89        15.92 10344738858 56731142126  206616204

The output is divided into two sections:

The first row shows the overall CPU usage for the system, including the percentage of time spent in user mode, system mode, and idle mode. The second row shows the I/O statistics for each block device on the system. iostat can be useful for identifying and troubleshooting I/O-related performance issues on a Linux system.

To display the I/O statistics in a more compact format, you can use the -x flag:

iostat -x

You can also use the -d flag to display only the disk statistics:

iostat -d

CleverUptime uses the iostat command to detect issues related to I/O performance.

The text above is licensed under CC BY-SA 4.0 CC BY SA