iostat Command in Linux

Back

In contrast to sar, the iostat command report more general input / output statistics for the system, not only for the CPU, but also for connected storage device, such as local drives and mounted shared NFS directories.


The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks.

The first report generated by the iostat command provides statistics concerning the time since the system was booted. Each subsequent report covers the time since the previous report. All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics.

 On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. When option -n is used, an NFS header row is displayed followed by a line of statistics for each network file-system that is mounted.

The interval parameter specifies the amount of time in seconds between each report. The first report contains statistics for the time since system start-up (boot). Each subsequent report contains statistics collected during the interval since the previous report. 

The count parameter can be specified in conjunction with the interval parameter. If the count parameter is specified, the value of count determines the number of reports generated at interval seconds apart. If the interval parameter is specified without the count parameter, the iostat command generates reports continuously.


The iostat command generates three types of reports, the CPU Utilization report, the Device Utilization report and the Network Files-ystem report.

CPU Utilization Report :

The first report generated by the iostat command is the CPU Utilization Report. For multiprocessor systems, the CPU values are global averages among all processors. 

Device Utilization Report :

The second report generated by the iostat command is the Device Utilization Report. The device report provides statistics on a per physical device or partition basis. Block devices for which statistics are to be displayed may be entered on the command line. Partitions may also be entered on the command line providing that option -x is not used. If no device nor partition is entered, then statistics are displayed for every device used by the system, and providing that the kernel maintains statistics for it. 

If the ALL keyword is given on the command line, then statistics are displayed for every device defined by the system, including those that have never been used. The report may show the following fields, depending on the flags use

Network Filesystem report :

The Network File-system (NFS) report provides statistics for each mounted network file-system. The report shows the following fields:

Filesystem:
This columns shows the host-name of the NFS server followed by a colon and by the directory name where the network file-system is mounted.