linux-disk-related commands Iostat

Source: Internet
Author: User

The Iostat is primarily used to monitor the IO load on the system device, iostat the statistics from the start of the system startup when the first run, and then running Iostat displays statistics from the last time the command was run. Users can obtain the required statistics by specifying the number and time of the statistics.

[[email protected] app]# yum list|grep iostatpcp-import-iostat2pcp.x86_64                 3.11.8-7.el7                base   [[email  protected] app]# yum -y install pcp-import-iostat2pcp[[email protected]  app]# iostatLinux 3.10.0-514.el7.x86_64  (Localhost.localdomain)  10/24/2017 _x86 _64_ (1 CPU) avg-cpu:  %user   %nice %system %iowait  %steal    %idle           0.44     0.00    0.30    0.04    0.00    99.22Device:            tps     kb_read/s    kb_wrtn/s    kb_read    kb_wrtnsda                0.43          9.55        14.19      737417    1095615scd0               0.00         0.00          0.00         44           0[[email protected] app]#

The meanings of each output item are as follows:

AVG-CPU segment: Overall CPU usage statistics, for multi-core CPUs, here is the average of all CPUs

%user: The percentage of CPU that is used to run at the user level.

The percentage of CPU used by the%nice:nice operation.

%sys: The percentage of CPU that is used to run at the system level (kernel).

%iowait:cpu CPU percentage that is used when waiting for hardware I/O. It indicates the time that the CPU waits for an IO request to complete, mainly looking at the value of iowait.

%idle:cpu the percentage of idle time.

Device segment: IO statistics for each disk device

TPS: The number of IO read and write requests per second that are issued by the process, the number of transmissions per second of the device (indicate, transfers per second, were issued to the.). "One-time transfer" means "one-time I/O request". Multiple logical requests may be merged into "one I/O request". The size of the "one transfer" request is unknown.

KB_READ/S: The amount of block data read from the device (drive expressed) per second (512bytes in one sector), in K;

KB_WRTN/S: The amount of block data written to the device (drive expressed) per second , in units of K;

Kb_read: The total amount of block data read , in units of K;

kb_wrtn: Write Blo CK Total amount of data , in units of K.


Grammar

Iostat [Options] [interval [count]]

Parameters

-d [Facility] indicates that the display device (disk) usage status, by default, monitors all the hard disk devices, you can specify a device, such as-D SDA. ;

-K Some columns using block are forced to use kilobytes units, the default unit block

-M some columns that use block units Force MB, the default unit block

[[email protected] app]# iostat -d -k 1 3   #没1秒一次   Refresh 3 disk usage status linux 3.10.0-514.el7.x86_64  (localhost.localdomain)  10/25/2017 _x86_64 (1  CPU) device:            tps     Kb_read/s    kb_wrtn/s    kb_read    kb_wrtnfd0                0.00          0.00         0.00           4           0sda               0.26          4.66         7.25      746585    1161425scd0               0.00         0.00          0.00         44           0Device:             tps    kb_read/s    kb_wrtn/s    kb_read     kB_wrtnfd0                0.00         0.00          0.00          0           0sda                0.00         0.00          0.00          0           0scd0               0.00         0.00          0.00          0           0Device:             tps    kb_read/s    kb_wrtn/s    kb_read     kB_wrtnfd0                0.00         0.00          0.00          0           0sda               0.00          0.00          0.00          0           0scd0               0.00         0.00          0.00          0           0[[email protected] app]# iostat -d -k 1  linux 3.10.0-514.el7.x86_64  (Localhost.localdomain)  10/25/2017 _x86_64 (1 CPU) Device:             tps    kb_read/s    kb_wrtn/s     kB_read    kB_wrtnfd0                0.00         0.00          0.00           4          0sda                0.26          4.66         7.25     746585     1161490scd0               0.00         0.00          0.00         44           0device:            tps    kb_ read/s    kb_wrtn/s    kb_read    kb_wrtnfd0                0.00          0.00         0.00           0           0sda               0.00          0.00         0.00           0           0scd0              0.00          0.00         0.00           0          0^c[[ Email protected] app]# iostat -d sda 1 4linux 3.10.0-514.el7.x86_64   (Localhost.localdomain)  10/25/2017 _x86_64 (1 CPU) device:             tps    kb_read/s    kb_wrtn/ s    kb_read    kb_wrtnsda                0.26         4.66          7.25     746585     1161502device:            tps    kb_read/s     kB_wrtn/s    kB_read    kB_wrtnsda                1.01          0.00         1.01           0          1device :             tps    kb_read/s     kB_wrtn/s    kB_read    kB_wrtnsda                0.00          0.00         0.00           0          0device:             tps    kB_read/s     kB_wrtn/s    kB_read    kB_wrtnsda                0.00          0.00         0.00           0          0[[email protected]  app]#

-x display and IO-related extended data

[[email protected] app]# iostat -d sda -x -k 1 1linux  3.10.0-514.el7.x86_64  (Localhost.localdomain)  10/25/2017 _x86_64_ (1 CPU) Device:          rrqm/s   wrqm/s     r/ S     w/s    rkb/s    wkb/s avgrq-sz  avgqu-sz   await r_await w_await  svctm  %utilsda                0.02      0.11    0.12    0.14    0 4.62      7.19    90.47     0.01    26.45   11.86   38.50   2.43   0.06[[email  protected] app]#

RRQM/S: How much of this device-dependent read request is merged per second (when the system call needs to read the data, the VFS sends the request to each FS, and if FS finds that different read requests read the same block data, FS merges the request into the merge);

WRQM/S: How much of this device-related write request is being merge per second.

RSEC/S: Number of sectors read per second;

wsec/: Number of sectors written per second.

Rkb/s:the number of read requests that were issued to the device per second, unit k;

Wkb/s:the number of write requests that were issued to the device per second, unit k;

Avgrq-sz average request sector size, Unit is sector

The Avgqu-sz is the length of the average request queue. There is no doubt that the shorter the queue, the better.

Await: The average time (in milliseconds) of processing per IO request. This can be understood as the response time of IO, generally the system IO response time should be less than 5ms, if greater than 10ms is relatively large.

This time includes the queue time and service time, that is, in general, await is greater than SVCTM, their difference is smaller, then the shorter the queue time, conversely, the greater the difference, the longer the queue time, indicating that the system has a problem.

SVCTM represents the average service time (in milliseconds) for each device I/O operation. If the value of SVCTM is close to await, indicating that there is little I/O waiting, disk performance is good, and if the value of await is much higher than the value of SVCTM, the I/O queue waits too long for the applications running on the system to become slower.

%util: All processing IO time in statistical time, divided by total statistic time, Util = (r/s+w/s) * (svctm/1000), util= (0.12+0.14) * (2.43/1000) = 0.0006318, so this parameter indicates how busy the device is.

。 Generally, if this parameter is 100% indicates that the device is already running close to full load (of course if it is a multi-disk, even if%util is 100% because of the concurrency of the disk, disk usage may not be the bottleneck).


-P Device | All

Mutually exclusive with the-X option to display statistics for block devices and system partitions. You can also specify a device name after-p, such as:

# iostat-p HDA

or Show All devices

# iostat-p All


-C Get CPU partial state value

-T prints the time to collect data when outputting data.

-V Prints the version number and help information.


This article is from "I am not a rookie" blog, please be sure to keep this source http://ityunwei2017.blog.51cto.com/7662323/1975864

linux-disk-related commands Iostat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.