iostat Command 参考

iostat Command

Purpose

       Reports Central Processing Unit (CPU) statistics, asynchronous input/output (AIO) and input/output statistics for the entire system, adapters, TTY
       devices, disks and CD-ROMs.

Syntax

       iostat [ -a ] [ -l ] [ -s ] [-t  ] [ -T ] [ -z ] [ { -A [ -P ] [ -q | -Q ] } | { [-d | -p] -D [-R ] }[ -m ] [ Drives ... ] [ Interval] [ Count ]

Description

       The iostat command is used to monitor system input/output (I/O) device loading by observing the time the physical disks are active in relation to
       their average transfer rates. The iostat command also generates reports that can be used to change system configuration to better balance the I/O
       load between physical disks and adapters.

       All statistics are reported each time the iostat command is run. The report consists of a TTY and CPU header row followed by a row of TTY or
       asynchronous I/O and CPU statistics. On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors.

       A header row with Number of CPUs and the Number of disks that are currently active in the system are printed at the beginning of the output. If the
       -s flag is specified, a system header row is displayed followed by a line of statistics for the entire system. The hostname of the system is printed
       in the system header row.

       If the -a flag is specified, an adapter-header row is displayed followed by a line of statistics for the adapter. This will be followed by a disk-
       header row and the statistics of all the disks/CD-ROMs connected to the adapter and by a tape-header row and the statistics of all the tapes
       connected to the adapter. Such reports are generated for all the disk adapters connected to the system.

       A disks header row is displayed followed by a line of statistics for each disk that is configured. If the PhysicalVolume parameter is specified,
       only those names specified are displayed.

       If the PhysicalVolume parameter is specified, one or more alphabetic or alphanumeric physical volumes can be specified. If the PhysicalVolume
       parameter is specified, the TTY and CPU reports are displayed and the disk report contains statistics for the specified drives. If a specified
       logical drive name is not found, the report lists the specified name and displays the message Drive Not Found. If no Logical Drive Names are
       specified, the report contains statistics for all configured disks and CD-ROMs. If no drives are configured on the system, no disk report is
       generated. The first character in the PhysicalVolume parameter cannot be numeric.

       The Interval parameter specifies the amount of time in seconds between each report. If the Interval parameter is not specified, the iostat command
       generates a single report containing statistics for the time since system startup (boot). 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 is useful in determining whether a physical volume is becoming a performance bottleneck and if there is potential to improve the
       situation. The % utilization field for the physical volumes indicates how evenly the file activity is spread across the drives. A high % utilization
       on a physical volume is a good indication that there may be contention for this resource. Since the CPU utilization statistics are also available
       with the iostat report, the percentage of time the CPU is in I/O wait can be determined at the same time. Consider distributing data across drives
       if the I/O wait time is significant and the disk utilization is not evenly distributed across volumes.

       Beginning with AIX 5.3, the iostat command reports number of physical processors consumed (physc) and the percentage of entitlement consumed (%
       entc) in Micro-Partitioning environments. These metrics will only be displayed on Micro-Partitioning environments.

       Starting with AIX 5.4, you can use the accounting based on the Scaled Performance Utilization Resources Register (SPURR). Use the SPURR on POWER6
       processor family. SPURR is similar to the Performance Utilization Resources Register (PURR), except that SPURR scales as a function of the degree of
       processor throttling. If the hardware provides the SPURR support, the CPU-utilization statistics shown by the iostat command are proportional to the
       frequency or the instruction dispatch rate of the processor. The CPU utilization statistics are capped to the PURR values in the turbo mode if the
       turbo mode accounting is disabled. You can enable the turbo mode accounting through the System Management Interface Tool (SMIT).

       Note: Some system resource is consumed in maintaining disk I/O history for the iostat command. Use the sysconfig subroutine, or the SMIT to stop
       history accounting. While the iostat command is running for Count of iterations and if there is a change in system configuration that affects the
       output of iostat command, it prints a warning message about the configuration change. It then continues the output after printing the updated system
       configuration information and the header.

Reports

       The iostat command generates four types of reports, the TTY and CPU Utilization report, the Disk Utilization report, the System throughput report
       and the Adapter throughput report.

TTY and CPU Utilization Report

       The first report generated by the iostat command is the TTY and CPU Utilization Report. For multiprocessor systems, the CPU values are global
       averages among all processors. Also, the I/O wait state is defined system-wide and not per processor. The report has the following format:
       Column
            Description
       tin
            Shows the total number of characters read by the system for all TTYs.
       tout
            Shows the total number of characters written by the system to all TTYs.
       % user
            Shows the percentage of CPU utilization that occurred while executing at the user level (application).
       % sys
            Shows the percentage of CPU utilization that occurred while executing at the system level (kernel).
       % idle
            Shows the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
       % iowait
            Shows the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
       physc
            Number of physical processors consumed, displayed only if the partition is running with shared processor.
       % entc
            The percentage of entitled capacity consumed, displayed only if the partition is running with shared processor. Because the time base over
            which this data is computed can vary, the entitled capacity percentage can sometimes exceed 100%. This excess is noticeable only with small
            sampling intervals.

       This information is updated at regular intervals by the kernel (typically sixty times per second). The TTY report provides a collective account of
       characters per second received from all terminals on the system as well as the collective count of characters output per second to all terminals on
       the system.

Methods Used to Compute CPU Disk I/O Wait Time

       Operating system version 4.3.3 and later contain enhancements to the method used to compute the percentage of CPU time spent waiting on disk I/O
       (wio time). The method used in AIX 4.3.2 and earlier versions of the operating system can, under certain circumstances, give an inflated view of wio
       time on SMPs. The wio time is reported by the commands sar (%wio), vmstat (wa) and iostat (% iowait).

       The method used in AIX 4.3.2 and earlier versions is as follows: At each clock interrupt on each processor (100 times a second per processor), a
       determination is made as to which of the four categories (usr/sys/wio/idle) to place the last 10 ms of time. If the CPU was busy in usr mode at the
       time of the clock interrupt, then usr gets the clock tick added into its category. If the CPU was busy in kernel mode at the time of the clock
       interrupt, then the sys category gets the tick. If the CPU was not busy, a check is made to see if any I/O to disk is in progress. If any disk I/O
       is in progress, the wio category is incremented. If no disk I/O is in progress and the CPU is not busy, the idle category gets the tick. The
       inflated view of wio time results from all idle CPUs being categorized as wio regardless of the number of threads waiting on I/O. For example,
       systems with just one thread doing I/O could report over 90 percent wio time regardless of the number of CPUs it has.

       The method used in AIX 4.3.3 and later is as follows: The change in operating system version 4.3.3 is to only mark an idle CPU as wio if an
       outstanding I/O was started on that CPU. This method can report much lower wio times when just a few threads are doing I/O and the system is
       otherwise idle. For example, a system with four CPUs and one thread doing I/O will report a maximum of 25 percent wio time. A system with 12 CPUs
       and one thread doing I/O will report a maximum of 8 percent wio time. NFS client reads/writes go through the VMM, and the time that biods spend in
       the VMM waiting for an I/O to complete is now reported as I/O wait time.

Disk or Tape Utilization Report

       The second report generated by the iostat command is the Diskor Tape Utilization Report. By default, the disk Utilization report is displayed, and
       you must specify the -p flag to display the Tape Utilization Report. The disk report provides statistics on a per-physical-disk basis, and tape
       utilization report provides statistics on a per-tape basis. The default report has a format similar to the following one:
       % tm_act
            Indicates the percentage of time the physical disk/tape was active (bandwidth utilization for the drive).
       Kbps
            Indicates the amount of data transferred (read or written) to the drive in KB per second.
       tps
            Indicates the number of transfers per second that were issued to the physical disk/tape. A transfer is an I/O request to the physical
            disk/tape. Multiple logical requests can be combined into a single I/O request to the disk. A transfer is of indeterminate size.
       Kb_read
            The total number of KB read.
       Kb_wrtn
            The total number of KB written.

       If you specify the -D flag, the report has the following metrics for disk or tape. Extended metrics for disk are displayed by default and users need
       to specify the -p option for tape utilization report:
       Metrics related to transfers (xfer):
       % tm_act
            Indicates the percentage of time the physical disk or tape was active (bandwidth utilization for the drive).
       bps
            Indicates the amount of data transferred (read or written) per second to the drive. Different suffixes are used to represent the unit of
            transfer. Default is in bytes per second.
       tps
            Indicates the number of transfers per second that were issued to the physical disk or tape. A transfer is an I/O request to the physical disk
            or tape. Multiple logical requests can be combined into a single I/O request to the disk. A transfer is of indeterminate size.
       bread
            Indicates the amount of data read per second, from the drive. Different suffixes are used to represent the unit of transfer. Default is in
            bytes per second.
       bwrtn
            Indicates the amount of data written per second, to the drive. Different suffixes are used to represent the unit of transfer. Default is in
            bytes per second.
       Read Service Metrics (read):
       rps
            Indicates the number of read transfers per second.
       avgserv
            Indicates the average service time per read transfer. Different suffixes are used to represent the unit of time. Default is in milliseconds.
       minserv
            Indicates the minimum read service time. Different suffixes are used to represent the unit of time. Default is in milliseconds.
       maxserv
            Indicates the maximum read service time. Different suffixes are used to represent the unit of time. Default is in milliseconds.
       timeouts
            Indicates the number of read timeouts per second.
       fails
            Indicates the number of failed read requests per second.
       Write Service Metrics (write):
       wps
            Indicates the number of write transfers per second.
       avgserv
            Indicates the average service time per write transfer. Different suffixes are used to represent the unit of time. Default is in milliseconds.
       minserv
            Indicates the minimum write service time. Different suffixes are used to represent the unit of time. Default is in milliseconds.
       maxserv
            Indicates the maximum write service time. Different suffixes are used to represent the unit of time. Default is in milliseconds.
       timeouts
            Indicates the number of write timeouts per second.

       fails
            Indicates the number of failed write requests per second.
       Wait Queue Service Metrics (queue):
            Restriction: These metrics are not applicable for tapes.
       avgtime
            Indicates the average time spent by a transfer request in the wait queue. Different suffixes are used to represent the unit of time. Default is
            in milliseconds.
       mintime
            Indicates the minimum time spent by a transfer request in the wait queue. Different suffixes are used to represent the unit of time. Default is
            in milliseconds.
       maxtime
            Indicates the maximum time spent by a transfer request in the wait queue. Different suffixes are used to represent the unit of time. Default is
            in milliseconds.
       avgwqsz
            Indicates the average wait queue size.
       avgsqsz
            Indicates the average service queue size.
       sqfull
            Indicates the number of times the service queue becomes full (that is, the disk is not accepting any more service requests) per second.
       Legend of suffixes representing different units of representation
       Suffix
            Description
       K
            1000 bytes
       M
            1 000 000 bytes if displayed in xfer metrics. Minutes, if displayed in read/write/wait service metrics.
       G
            1 000 000 000 bytes.
       T
            1 000 000 000 000 bytes.
       S
            Seconds.
       H
            Hour.  Note: For drives that do not support service time metrics, read, write and wait queue service metrics will not be displayed.

       Statistics for CD-ROM devices are also reported.

System Throughput Report

       This report is generated if the -s flag is specified. This report provides statistics for the entire system. This report has the following format:
       Kbps
            Indicates the amount of data transferred (read or written) in the entire system in KB per second.
       tps
            Indicates the number of transfers per second issued to the entire system.
       Kb_read
            The total number of KB read from the entire system.
       Kb_wrtn
            The total number of KB written to the entire system.

Adapter Throughput Report

       This report is generated if the -a flag is specified. This report provides statistics on an adapter-by-adapter basis (for both physical and virtual
       adapters). This report has the following format for a physical adapter report:
       Kbps
            Indicates the amount of data transferred (read or written) in the adapter in KB per second.
       tps
            Indicates the number of transfers per second issued to the adapter.
       Kb_read

            The total number of KB read from the adapter.
       Kb_wrtn
            The total number of KB written to the adapter.

       The virtual adapter's default throughput report has the following format:
       Kbps
            Indicates the amount of data transferred (read or written) in the adapter in KB per second.
       tps
            Indicates the number of transfers per second issued to the adapter.
       bkread
            Number of blocks received per second from the hosting server to this adapter.
       bkwrtn
            Number of blocks per second sent from this adapter to the hosting server.
       partition-id
            The partition ID of the hosting server, which serves the requests sent by this adapter.

       The virtual adapter's extended throughput report (-D option) has the following format:
       Metrics related to transfers (xfer:)
       Kbps
            Indicates the amount of data transferred (read or written) in the adapter in KB per second.
       tps
            Indicates the number of transfers per second issued to the adapter.
       bkread
            Number of blocks received per second from the hosting server to this adapter.
       bkwrtn
            Number of blocks per second sent from this adapter to the hosting server.
       partition-id
            The partition ID of the hosting server, which serves the requests sent by this adapter.
       Adapter Read Service Metrics (read:)
       rps
            Indicates the number of read requests per second.
       avgserv
            Indicates the average time to receive a response from the hosting server for the read request sent. Different suffixes are used to represent
            the unit of time. Default is in milliseconds.
       minserv
            Indicates the minimum time to receive a response from the hosting server for the read request sent. Different suffixes are used to represent
            the unit of time. Default is in milliseconds.
       maxserv
            Indicates the maximum time to receive a response from the hosting server for the read request sent. Different suffixes are used to represent
            the unit of time. Default is in milliseconds.
       Adapter Write Service Metrics (write:)
       wps
            Indicates the number of write requests per second.
       avgserv
            Indicates the average time to receive a response from the hosting server for the write request sent. Different suffixes are used to represent
            the unit of time. Default is in milliseconds.
       minserv
            Indicates the minimum time to receive a response from the hosting server for the write request sent. Different suffixes are used to represent
            the unit of time. Default is in milliseconds.
       maxserv
            Indicates the maximum time to receive a response from the hosting server for the write request sent. Different suffixes are used to represent
            the unit of time. Default is in milliseconds.
       Adapter Wait Queue Metrics (queue:)
       avgtime
            Indicates the average time spent by a transfer request in the wait queue. Different suffixes are used to represent the unit of time. Default is
            in milliseconds.
       mintime
            Indicates the minimum time spent by a transfer request in the wait queue. Different suffixes are used to represent the unit of time. Default is
            in milliseconds.

       maxtime
            Indicates the maximum time spent by a transfer request in the wait queue. Different suffixes are used to represent the unit of time. Default is
            in milliseconds.
       avgwqsz
            Indicates the average wait queue size.
       avgsqsz
            Indicates the average service queue size.
       sqfull
            Indicates the number of times the service queue becomes full (that is, the hosting server is not accepting any more service requests) per
            second.
       Legend of suffixes representing different units of representation
       Suffix
            Description
       K
            1000 bytes.
       M
            1 000 000 bytes if displayed in xfer metrics. Minutes, if displayed in read/write/wait service metrics.
       G
            1 000 000 000 bytes.
       T
            1 000 000 000 000 bytes.
       S
            Seconds.
       H
            Hours.

Asynchronous I/O report

       The asynchronous I/O report has the following column headers :
       avgc
            Average global AIO request count per second for the specified interval.
       avfc
            Average fastpath request count per second for the specified interval.
       maxgc
            Maximum global AIO request count since the last time this value was fetched.
       maxfc
            Maximum fastpath request count since the last time this value was fetched.
       maxreqs
            Maximum AIO requests allowed.

Disk Input/Output History

       To improve performance, the collection of disk input/output statistics has been disabled. To enable the collection of this data, type:

       chdev -l sys0 -a iostat=true

       To display the current settings, type:

       lsattr -E -l sys0 -a iostat

       If the collection of disk input/output history is disabled and iostat is called without an interval, the iostat output displays the message Disk
       History Since Boot Not Available instead of disk statistics.

Flags

       -a
            Specifies the Adapter Throughput Report. The -a flag can be specified with the -A flag, but not when -q or -Q flags are specified.
       -A

            Displays the AIO statistics for the specified interval and count.
       -d
            Specifies drive report only.
       -D
            Specifies the extended disk or tape report. If neither the -p flag nor the -d flag is specified along with the -D flag, then the default is
            disk only.
       -l
            Displays the output in long listing mode. The default column width is 80.
       -m
            Specifies the statistics for paths.
       -p
            Displays the tape statistics.
       -P
            Displays the Adapter Throughput report, using the POSIX AIO calls.
       -q
            Specifies AIO queues and their request counts. The -q flag can be specified only with the -A flag.
       -Q
            Displays a list of all the mounted filesystems and the associated queue numbers with their request counts. The -Q flag can be specified only
            with the -A flag.
       -R
            Specifies that the reset of min* and max* values should happen at each interval. The default is to reset the values once when iostat is
            started. The -R flag can be specified only with the -D flag.
       -s
            Specifies the system throughput report. The -s flag can be specified with the -A flag, but not when -q or -Q flags are specified.
       -t
            Specifies TTY/CPU report only. The -t flag is mutually exclusive with the -d or -D flags.
       -T
            Specifies the time stamp.
       -z
            Resets the disk input/output statistics. Only root users can use this option.

Examples
       1    To display a single history since boot report for all TTY, CPU, and Disks, type:

            iostat
       2    To display a continuous disk report at two second intervals for the disk with the logical name disk1, type:

            iostat -d disk1 2
       3    To display six reports at two second intervals for the disk with the logical name disk1, type:

            iostat disk1 2 6
       4    To display six reports at two second intervals for all disks, type:

            iostat -d 2 6
       5    To display six reports at two second intervals for three disks named disk1, disk2, disk3, type:

            iostat disk1 disk2 disk3 2 6
       6    To print the System throughput report since boot, type:

            iostat -s
       7    To print the Adapter throughput reports at 5-second intervals, type:

            iostat -a 5
       8    To print 10 System and Adapter throughput reports at 20-second intervals, with only the TTY and CPU report (no disk reports), type:

            iostat -sat 20 10

       9    To print the System and Adapter throughput reports with the Disk Utilization reports of hdisk0 and hdisk7 every 30 seconds, type:

            iostat -sad hdisk0 hdisk7 30
       10   To display time stamp next to each line of output of iostat, type:

            iostat -T 60
       11   To display 6 reports at 2-second intervals on AIO, type:

            iostat -A 2 6
       12   To display AIO statistics since boot for queues associated with all mounted filesystems, type:

            iostat -A -Q
       13   To display extended drive report for all disks, type:

            iostat -D
       14   To display extended drive report for all tapes, type:

            iostat -Dp
       15   To display extended drive report for a specific disk, type:

            iostat -D hdisk0
       16   To reset the disk input/output statistics, type:

            iostat -z

File

       /usr/bin/iostat
            Contains the iostat command.

Related Information

       The vmstat command.

       Monitoring disk I/O in Performance management

       The Input and Output Handling Programmer's Overview in AIX 5L Version 5.3 General Programming Concepts: Writing and Debugging Programs describes the
       files, commands, and subroutines used for low-level, stream, terminal, and asynchronous I/O interfaces.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值