当前位置: 首页 > Conf, Linux > 正文

iostat command examples

iostat is one of mostly used performance tools for troubleshooting on Linux, it reports CPU statistics and input/output statistics for devices, partitions and NFS.

Here are some useful command examples:

Basic command examples

Display a single history since boot report for all CPU and Devices

Display a continuous device report at two second intervals.

Display six reports at two second intervals for all devices.

Omit the first report in multiple report mode.

In multiple reports, the first one always shows the statistics since boot, to omit the first report, try

In the case above, the total number of output is 5

Display six reports of extended statistics at two second intervals for devices hda and hdb.

Display six reports at two second intervals for device sda and all its partitions (sda1, etc.)

Report output explanation

The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization 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:

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, 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.  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:

Display only CPU statistics

Display only NFS statistics

Display only disk statistics

Display one or multiple disks io statistics

Note: with option ‘-p’, iostat displays statistics for block devices and all their partitions, sda in the example above

Display one or multiple disks by persistent disk name

Especially useful if you have multpath devices,here is the syntax

Display  persistent  device  names. Options ID, LABEL, etc. specify the type of the persistent name. These options are not limited, only prerequisite is that directory with required persistent names is present in /dev/disk.  Optionally, multiple devices can be specified in the chosen persistent name type.

Note: The persistent name is from /dev/disk/by-id/

iostat – Display I/O data in group

Don’t want show individual disks in the group output? Try this:

iostat – Display I/O data in MB/second

Default output is in KB/sec, this command shows output in MB/sec

iostat – Display with timestamp

Want timestamp in the output? here is it

Display extended statistics info

Where

本文固定链接: http://t.yjsec.com/index.php/2018/03/02/416/ | 下一站

该日志由 admin 于2018年03月02日发表在 Conf, Linux 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: iostat command examples | 下一站

iostat command examples:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter