iostat [ -c ] [ -d ] [ -h ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ]
[ -z ] [ [ [ -T ] -g group_name ] { device [...] | ALL } ]
[ -p [ device [,...] | ALL ] ] [ interval [ count ] ]
报告书
该iostat的命令生成三种类型的报告:CPU使用率报告,该设备利用率报告和网络文件系统的报告。
CPU使用率报告
iostat命令生成的第一个报告是CPU利用率报告。对于多处理器系统,CPU值是所有处理器之间的全局平均值。该报告具有以下格式:
%user
|
显示在用户(应用程序)级别执行时发生的CPU利用率百分比。
|
%nice
|
显示具有良好 优先级的用户级别执行时发生的CPU利用率百分比。
|
%system
|
显示在系统(内核)级别执行时发生的CPU利用率百分比。
|
%iowait
|
显示在系统有未完成的磁盘I / O请求期间,一个或多个CPU空闲的时间百分比。
|
%steal
|
显示在管理程序为另一个虚拟处理器提供服务时,一个或多个虚拟CPU在非自愿等待中花费的时间百分比。
|
%idle
|
显示一个或多个CPU空闲且系统没有未完成的磁盘I / O请求的时间百分比。
|
设备使用率报告
iostat命令生成的第二个报告是“设备使用率报告”。设备报告提供了基于每个物理设备或分区的统计信息。可以在命令行上输入要显示其统计信息的块设备和分区。如果未输入设备或分区,则将显示系统使用的每个设备的统计信息,前提是内核需要为其维护统计信息。
如果在命令行上指定了ALL 关键字,则将显示系统定义的每个设备的统计信息,包括从未使用过的设备。除非设置了环境变量 POSIXLY_CORRECT,否则默认情况下传输速率以1K块为单位,在这种情况下,将使用512字节的块。该报告可能显示以下字段,具体取决于所使用的标志:
Device
|
此列提供/ dev目录中列出的设备(或分区)名称。
|
tps
|
指示每秒发送到设备的传输次数。传输是对设备的I / O请求。多个逻辑请求可以组合成对设备的单个I / O请求。传输的大小不确定。
|
Blk_read / s(kB_read / s,MB_read / s)
|
表示从设备读取的数据量,以每秒的块数(千字节,兆字节)表示。块等同于扇区,因此大小为512字节。
|
Blk_wrtn / s(kB_wrtn / s,MB_wrtn / s)
|
指示写入设备的数据量,以每秒的块数(千字节,兆字节)表示。
|
Blk_read(kB_read,MB_read)
|
读取的总块数(千字节,兆字节)。
|
Blk_wrtn(kB_wrtn,MB_wrtn)
|
写入的总块数(千字节,兆字节)。
|
rrqm /s
|
每秒排队到设备中的读取请求的数量。
|
wrqm /s
|
每秒排队到设备中的合并写入请求的数量。
|
r /s
|
每秒设备完成的读取请求数(合并后)。
|
w / s
|
每秒设备完成的写请求数(合并后)。
|
rsec / s(rkB / s,rMB / s)
|
每秒从设备读取的扇区数(千字节,兆字节)。
|
wsec / s(wkB / s,wMB / s)
|
每秒写入设备的扇区数(千字节,兆字节)。
|
avgrq-sz
|
发出到设备的请求的平均大小(以扇区为单位)。
|
avgqu-sz
|
发出到设备的请求的平均队列长度。
|
r_await
|
发出给要服务的设备的I / O请求的平均时间(以毫秒为单位)。这包括队列中的请求所花费的时间以及为请求服务所花费的时间。
|
r_await
|
发送给要服务的设备的读取请求的平均时间(以毫秒为单位)。这包括队列中的请求所花费的时间以及为请求服务所花费的时间。
|
w_await
|
发出要服务的设备的写请求的平均时间(以毫秒为单位)。这包括队列中的请求所花费的时间以及为请求服务所花费的时间。
|
svctm
|
发出给设备的I / O请求的平均服务时间(以毫秒为单位)。警告!不再相信这个领域!将来的sysstat版本中将删除此字段。
|
%util
|
向设备发出I / O请求的CPU时间百分比(设备的带宽利用率)。当该值接近100%时,发生器件饱和。
|
选件
-C
|
显示CPU利用率报告。
|
-d
|
显示设备利用率报告。
|
-g group_name {device[...] | ALL}
|
显示一组设备的统计信息。所述的iostat为列表中的每个设备命令报告统计,然后该组全局统计的线显示为组名由列表中的所有设备的向上。
该ALL关键字意味着,所有由系统定义块装置应被包括在组中。
|
-H
|
使设备使用情况报告更易于人阅读。(那是你!)
|
-k
|
显示统计信息(以千字节/秒为单位)。
|
-m
|
显示统计信息,以每秒兆字节为单位。
|
-N
|
显示任何设备映射器设备的注册设备映射器名称。用于查看LVM2统计信息。
|
-p [{devicce[ , ...] | ALL}]
|
该-p选项显示的统计数据块设备和由该系统所使用的所有的分区。如果在命令行上输入了设备名称,则将显示该设备及其所有分区的统计信息。
该ALL关键字表示统计必须显示对于所有的块设备和分区由系统定义的,包括那些从未使用过。
|
-T
|
此选项必须与选项-g一起使用,并指示仅显示该组的全局统计信息,而不显示该组中各个设备的统计信息。
|
-t
|
打印显示的每个报告的时间。时间戳格式可能取决于S_TIME_FORMAT环境变量的值(请参见下文)。
|
-V
|
打印版本号并退出。
|
-X
|
显示扩展统计信息。
|
-z
|
告诉iostat忽略在采样期间没有任何活动的任何设备的输出。
|
环境
该iostat的命令考虑到了以下环境变量:
S_TIME_FORMAT
|
如果此变量存在且其值为ISO,则在报表标题中打印日期时,将忽略当前语言环境。该iostat的命令将使用ISO 8601格式(YYYY - MM - DD)来代替。选项-t所显示的时间戳也将符合ISO 8601格式。
|
POSIXLY_CORRECT
|
设置此变量后,传输速率将以512-K块而不是默认的1K块显示。
|
iostat [ -c ] [ -d ] [ -h ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ]
[ -z ] [ [ [ -T ] -g group_name ] { device [...] | ALL } ]
[ -p [ device [,...] | ALL ] ] [ interval [ count ] ]
Reports
The iostat command generates three types of reports: the CPU Utilization report, the Device Utilization report and the Network Filesystem 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. The report has the following format:
%user
|
Show the percentage of CPU utilization that occurred while executing at the user (application) level.
|
%nice
|
Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
|
%system
|
Show the percentage of CPU utilization that occurred while executing at the system (kernel) level.
|
%iowait
|
Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
|
%steal
|
Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
|
%idle
|
Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
|
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 and partitions for which statistics are to be displayed may be entered on the command line. If no device nor partition is entered, then statistics are displayed for every device used by the system, 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. Transfer rates are shown in 1K blocks by default, unless the environment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. The report may show the following fields, depending on the flags used:
Device
|
This column gives the device (or partition) name as listed in the /dev directory.
|
tps
|
Indicate the number of transfers per second that were issued to the device. A transfer is an I/O request to the device. Multiple logical requests can be combined into a single I/O request to the device. A transfer is of indeterminate size.
|
Blk_read/s (kB_read/s, MB_read/s)
|
Indicate the amount of data read from the device expressed in a number of blocks (kilobytes, megabytes) per second. Blocks are equivalent to sectors and therefore have a size of 512 bytes.
|
Blk_wrtn/s (kB_wrtn/s, MB_wrtn/s)
|
Indicate the amount of data written to the device expressed in a number of blocks (kilobytes, megabytes) per second.
|
Blk_read (kB_read, MB_read)
|
The total number of blocks (kilobytes, megabytes) read.
|
Blk_wrtn (kB_wrtn, MB_wrtn)
|
The total number of blocks (kilobytes, megabytes) written.
|
rrqm/s
|
The number of read requests merged per second that were queued to the device.
|
wrqm/s
|
The number of write requests merged per second that were queued to the device.
|
r/s
|
The number (after merges) of read requests completed per second for the device.
|
w/s
|
The number (after merges) of write requests completed per second for the device.
|
rsec/s (rkB/s, rMB/s)
|
The number of sectors (kilobytes, megabytes) read from the device per second.
|
wsec/s (wkB/s, wMB/s)
|
The number of sectors (kilobytes, megabytes) written to the device per second.
|
avgrq-sz
|
The average size (in sectors) of the requests that were issued to the device.
|
avgqu-sz
|
The average queue length of the requests that were issued to the device.
|
await
|
The average time (in milliseconds) for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
|
r_await
|
The average time (in milliseconds) for read requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
|
w_await
|
The average time (in milliseconds) for write requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
|
svctm
|
The average service time (in milliseconds) for I/O requests that were issued to the device. Warning! Do not trust this field anymore! This field will be removed in a future sysstat version.
|
%util
|
Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.
|
Options
-c
|
Display the CPU utilization report.
|
-d
|
Display the device utilization report.
|
-g group_name { device [...] | ALL }
|
Display statistics for a group of devices. The iostat command reports statistics for each device in the list, then a line of global statistics for the group displayed as group_name made up of all the devices in the list.
The ALL keyword means that all the block devices defined by the system shall be included in the group.
|
-h
|
Make the Device Utilization Report easier to read by a human. (That's you!)
|
-k
|
Display statistics in kilobytes per second.
|
-m
|
Display statistics in megabytes per second.
|
-N
|
Display the registered device mapper names for any device mapper devices. Useful for viewing LVM2 statistics.
|
-p [ { device [,...] | ALL } ]
|
The -p option displays statistics for block devices and all their partitions that are used by the system. If a device name is entered on the command line, then statistics for it and all its partitions are displayed.
The ALL keyword indicates that statistics have to be displayed for all the block devices and partitions defined by the system, including those that have never been used.
|
-T
|
This option must be used with option -g and indicates that only global statistics for the group are to be displayed, and not statistics for individual devices in the group.
|
-t
|
Print the time for each report displayed. The timestamp format may depend on the value of the S_TIME_FORMAT environment variable (see below).
|
-V
|
Print version number and exit.
|
-x
|
Display extended statistics.
|
-z
|
Tell iostat to omit output for any devices for which there was no activity during the sample period.
|
Environment
The iostat command takes into account the following environment variables:
S_TIME_FORMAT
|
If this variable exists and its value is ISO then the current locale will be ignored when printing the date in the report header. The iostat command will use the ISO 8601 format (YYYY-MM-DD) instead. The timestamp displayed with option -t will be also be compliant with ISO 8601 format.
|
POSIXLY_CORRECT
|
When this variable is set, transfer rates are displayed in 512-K blocks instead of the default 1K blocks.
|
未知的网友