Linux IO Real-time monitoring Iostat command detailed

Source: Internet
Author: User

Introduction

Linux system has a performance problem, generally we can use top, iostat, free, vmstat and other commands to view the initial positioning problems. Where Iostat is primarily used to monitor the IO load on the system device, Iostat displays statistics from the start of the system startup at the first run, and then runs 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.

Grammar
Iostat [-c] [-d] [-h] [-n] [-K |-m] [-t] [-v] [-X] [-z] [device [...] | ALL] [-p [device [,...] | all] [interval [count]]

Getting Started with
Iostat-d-K 2

The parameter-D indicates that the device (disk) usage status is displayed; k Some columns that use block are forced to use kilobytes, and 2 indicates that the data appears refreshed every 2 seconds.

The output is as follows

Iostat-d-K110Device:tps kb_read/s kb_wrtn/S Kb_read KB_WRTNSDA39.2921.141.4444133980729990031Sda10.000.000.00162332uSda21.321.434.542983427394827104Sda36.300.8524.9517816289520725244Sda50.850.463.40954350370970116Sda60.000.000.00550236Sda70.000.000.0050W0Sda80.000.000.0050W0Sda90.000.000.00 406 0SDA10 60.68 18.35 383002263 1490928140 device:tps kb_read/s kb_wrtn/s kb_read KB_WRTNSDA 327.55 5159.18 102.04 100sda1 0.00 0.00 0.00 0 0   

The meaning of the output information

TPS: 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 combined as " one-time I/O requests ". the size of the "one-time transfer " request is unknown. KB_READ/S: The amount of data read from the device (drive expressed) per second;
kb_wrtn/S: The amount of data written to the device (drive expressed) per second;
Kb_read: The total amount of data read, KB_WRTN: The amount of total data written, all of which are kilobytes.

In the example above, we can see statistics on the disk SDA and its partitions, when the total disk TPS for statistics is 39.29, and the following is the TPS for each partition. (because it is an instantaneous value, the total TPS is not strictly equal to the sum of each partition TPs)

Specifies that the monitored device name is SDA, and that the output of the command is exactly the same as the command above.

2

By default, all hard disk devices are monitored and are now designated to monitor SDA only.

- x parameter

Iostat also has a more common option- x, which will be used to display and IO-related extended data.

Iostat-d-x-k110device:rrqm/s wrqm/s r/sw/s rsec/s wsec/s rkb/s wkb/s avgrq-sz avgqu-sz await SVCTM%Utilsda1.5628.317.8031.4942.512.9221.261.461.16 0.03 0.79 2.62 10.28device:rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkb/s wkb/s avgrq-sz avgqu-sz await SVCTM%utilsda 2.00 20.00 381.00 7.00 12320.00 216.00  6160.00 108.00 32.31 4.50 2.17 84.20  

Meaning of the output information

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 per second has been merge. rsec/S: Number of sectors read per second; wsec/: The number of sectors written per second. rkb/s:the number of Read requests, were issued to the device per second;wkb/s:the number of write requests that were issued to the device per second ; Avgrq-sz the size of the average request sector 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, divided by total statistic time, in the statistical time. For example, if the statistic interval is 1 seconds, the device has 0.8 seconds to process Io, and 0.2 seconds is idle, then the device's%util = 0.8/80%, so this parameter implies the busy level of the device
. 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).

- C parameter

Iostat can also be used to get CPU partial state values:

avg-cpu:%user% nice%sys%iowait%idle86.22avg-cpu:%user%uh%sys%iowait%Idle 63.67       

Common usage
         2            #查看cpu状态 

Example Analysis
Ostat-d-K1 |GrepSda10device:tps kb_read/s kb_wrtn/S Kb_read kb_wrtnsda1060.7218.9571.533956376471493241908Sda10299.024266.67129.414352132Sda10483.84 4589.90 4117.17 4544 4076sda10 218.00 3360.00 100.00 100sda10 546.00 Span style= "color: #800080;" >8784.00 124.00 8784 sda10 827.00  13232.00 136.00 13232                 

As seen above, the average number of disk transfers per second is about 400, and the disk reads about 5MB per second and writes about 1MB.

Iostat-d-x-k1device:rrqm/s wrqm/s r/sw/s rsec/s wsec/s rkb/s wkb/s avgrq-sz avgqu-sz await SVCTM%Utilsda1.5628.317.8431.5043.653.1621.821.581.190.030.802.6110.29Sda1.9824.75419.806.9313465.35 253.47  6732.67 126.73 32.15 4.70 2.00 85.25< Span style= "color: #000000;" >SDA 3.06 41.84 444.90 Span style= "color: #800080;" >54.08 14204.08 2048.98 7102.04 1024.49 32.57 Span style= "color: #800080;" >2.10 4.21 1.85 92.24  

You can see the average response time of the disk <5ms, and the disk usage is >80. The disk responds properly, but it is already busy.

Transfer from http://www.orczhou.com/index.php/2010/03/iostat-detail/

Linux IO Real-time monitoring Iostat command detailed

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.