Forrest logo
back to the iostat tool

iostat:tldr:4ae5c

iostat: Display a report of CPU and disk statistics since system startup.
$ iostat
try on your machine

The iostat command is a utility used in Unix-like operating systems to monitor and report input/output (I/O) statistics of a system's disk drives, partitions, CPU utilization, and overall system load. It provides valuable information about the performance and throughput of the I/O devices and can be used to diagnose performance issues.

When you run the iostat command, it displays a table with several columns containing statistics such as:

  • Device: This column lists the name of the disk device or partition for which the statistics are being displayed.
  • tps: Stands for "transfers per second" and represents the number of I/O operations (read or write) being performed per second.
  • kB_read/s, kB_wrtn/s: These columns represent the number of kilobytes read from and written to the device per second, respectively.
  • kb_read, kb_wrtn: Indicate the total number of kilobytes read from and written to the device since boot-up.
  • %util: Shows the percentage of time the device is utilized. It signifies the amount of time the device is busy serving I/O requests.

The iostat command also provides additional information about CPU usage, including user-level, system-level, and idle CPU times. It can help identify bottlenecks, understand system utilization, and aid in disk performance analysis.

By default, iostat provides immediate statistics since the system's last reboot. However, you can specify an interval and number of iterations to gather statistics at regular intervals.

Example usage:

iostat -d 5 3

In this example, iostat will display disk I/O statistics every 5 seconds for a total of 3 times.

It's worth noting that iostat may not be available by default on all systems. You may need to install it or use alternative tools like vmstat or sar to gather similar information.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the iostat tool