Updated: 2022/Sep/29

Please read Privacy Policy. It's for your privacy.


IOSTAT(8)                   System Manager's Manual                  IOSTAT(8)

NAME
     iostat - report I/O statistics

SYNOPSIS
     iostat [-CDdITXxyz] [-c count] [-H height] [-W width] [-w wait] [drives]

DESCRIPTION
     iostat displays kernel I/O statistics on terminal, disk and CPU
     operations.  By default, iostat displays one line of statistics averaged
     over the machine's run time.  The use of -c or -w presents successive
     lines averaged over the wait period.  The -I option causes iostat to
     print raw, unaveraged values (totals).

     Only the last disk option specified (-d, -D, -X, -x, or -y) is used.

     The options are as follows:

     -C          Show CPU statistics.  This is enabled by default unless any
                 of the -D, -d, -T, -X, -x, or -y flags are used.

     -c count    Repeat the display count times.  Unless the -I flag is in
                 effect, the first display is for the time since a reboot and
                 each subsequent report is for the time period since the last
                 display.  If no wait interval is specified, the default is 1
                 second.

     -D          Show alternative disk statistics.  Displays number of
                 transfers, kilobytes transferred, and time spent in
                 transfers, during the wait period (or since boot with -I).
                 Use of this flag disables the default display.

     -d          Show disk statistics.  This is the default.  Displays number
                 of transfers per second, kilobytes per transfer, and
                 megabytes transferred per second.  Use of this flag disables
                 the default display of CPU and tty statistics.

     -H height   Set the page size (length, or height) explicitly, as the
                 number of lines, height.  If not set, the page length is
                 taken from the environment variable LINES if set, or from the
                 terminal (window) size, if output is to a terminal and its
                 size is set, and otherwise defaults to 20.  If explicitly set
                 to zero, pages are considered to be infinitely long.  This
                 parameter determines the frequency at which repeated headers
                 are output.  If the value is greater than zero, but too small
                 for the header, along with one output set, then a new header
                 will be produced for each set of output.

     -I          Show the running total values, rather than an average.

     -T          Show tty statistics.  This is enabled by default unless one,
                 or more, of the -C, -D, -d, -X, -x, or -y flags are used.

     -W width    Set the page width explicitly, as the number of columns of
                 characters, width.  If not set, the page width is taken from
                 the environment variable COLUMNS if set, or from the terminal
                 (window) size, if output is to a terminal and its size is
                 set, and otherwise defaults to 80.  If explicitly set to 0,
                 lines are considered infinitely long.  This width is used
                 only to determine the number of drives to display by default
                 when no drive list is given.  In other cases output will be
                 as wide as needed to display the data requested.

     -w wait     Pause wait seconds between each display.  If no repeat count
                 is specified, the default is infinity.

     -X          Show limited alternative disk statistics.  Displays megabytes
                 transferred, and time spent in transfers, during the wait
                 period (or since boot with -I).  Use of this flag disables
                 the default display.

     -x          Show extended disk statistics.  Each disk is displayed on a
                 line of its own with all available statistics.  This option
                 overrides all other display options, and all disks are
                 displayed unless specific disk names are provided as
                 arguments.  Additionally, separate read and write statistics
                 are displayed.  The -C and -T options are ignored with this
                 output format.

     -y          Shows the extended statistics (as with -x) and additional
                 queuing statistics.  Output does not fit in an 80 column
                 window.  The -C and -T options are ignored with this output
                 format.

     -z          Replaces drive and CPU statistic outputs that are exactly
                 zero with spaces.  Note that zero values can still appear -
                 this indicates a value that was not zero, but was rounded
                 down so appears as zero.  Drive output is replaced by spaces
                 only when the drive did no input or output at all in the
                 interval, or with -I, has never done any I/O.

     iostat displays its information in the following format:

     tty
           tin     characters read from terminals
           tout    characters written to terminals

     disks
           Disk operations.  The header of the field is the disk name and unit
           number.  If more drives are configured in the system that fit
           across the current display, iostat displays only those drives that
           fit on the display.  To force iostat to display specific drives,
           they may be supplied on the command line, either as names or
           fnmatch() patterns.

           t/s     transfers per second
           KB/t    Kilobytes transferred per disk transfer
           MB/s    Megabytes transferred per second

           The alternative display format, (selected with -D), presents the
           following values:

           xfr     Disk transfers
           KB      Kilobytes transferred
           time    Seconds spent in disk activity

           With the -y flag, the following queuing measurements are added:

           wait    Number of I/O requests queued up
           actv    Number of currently active I/O requests
           wsvc_t  Average waiting time of an I/O request in milliseconds
           asvc_t  Average duration of an I/O request in milliseconds
           wtime   Seconds spent in the waiting queue.  Queuing data might not
                   be available from all drivers and is then shown as zeros.

           With the -X flag, the following queuing measurements are added:

           MB/s    Megabytes transferred per second
           time    Seconds spent in disk activity

     cpu
           us      % of CPU time in user mode
           ni      % of CPU time in user mode running niced processes
           sy      % of CPU time in system mode
           in      % of CPU time in interrupt mode
           id      % of CPU time in idle mode

           Note that because of rounding, these percentages may appear to
           total more or less than 100.

SEE ALSO
     fstat(1), netstat(1), nfsstat(1), ps(1), systat(1), vmstat(1),
     fnmatch(3), pstat(8)

     The sections starting with ``Interpreting system activity'' in Installing
     and Operating 4.3BSD.

HISTORY
     iostat appeared in Version 6 AT&T UNIX.  The -x option was added in
     NetBSD 1.4.  Collection of queuing values and the -y option were added in
     NetBSD 8.0.  The -X option was added in NetBSD 11.0.  The archaic option
     format:
        iostat [drives ...] [wait [count]]
     remains supported (the first drive whose name starts with a digit is
     taken to be the wait period) but is deprecated, and may be removed in a
     future version, so should not be used.

NetBSD 10.99                     July 28, 2023                    NetBSD 10.99