Detailed description of iostat-dx 1 command to monitor IO Performance

Source: Internet
Author: User

Many of the website's performance problems will eventually come down to I/O, so it is necessary to understand the iostat command.

TIPS: Do you know where iostat gets IO-related information? Use the strace command to track the answer:

shell> strace -eopen iostatopen("/proc/diskstats", O_RDONLY)

Note: For more information about diskstats, see the official documentation (field1 ~ Field11 ).

The most commonly used iostat command format is "iostat-dx 1", which means that I/O Extension information is displayed every second.

shell> iostat -dx 1Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/ssda 0.18 37.71 0.65 2.63 50.18 322.08avgrq-sz avgqu-sz await svctm %util113.46 0.35 107.49 1.67 0.55Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/ssda 0.00 4208.00 0.00 165.00 0.00 163872.00avgrq-sz avgqu-sz await svctm %util993.16 119.54 1144.36 6.07 100.10

Note: The average value starting from system startup is displayed at the beginning, followed by the average value in each interval.

If you do not have the iostat command in your operating system, you can install it from the source code by using the following methods:

  • Centos/Fedora Installation Method: yum install sysstat
  • Debian/Ubuntu Installation Method: aptitude install sysstat

This section describes the meanings of related parameters:

  • Rrqm/s: Number of read requests merged per second in the queue
  • Wrqm/s: Number of write requests merged per second in the queue
  • R/s: Number of read requests completed per second
  • W/s: Number of write requests completed per second
  • Rsec/s: number of sectors read per second
  • Wsec/s: number of sectors written per second
  • Avgrq-sz: average request data size
  • Avgqu-sz: average length of the Request queue
  • Await: average waiting time for each request
  • Svctm: Average service time of each request
  • Util: Device Utilization

Note: We recommend that you compare the source code to remember how these parameters are calculated.

The following parameters are more important: util, svctm, await, avgqu-sz:

Util is the utilization rate of the device. If it is close to 100%, it usually indicates that the device capability tends to be saturated (not absolute, for example, the device has a write cache ). Sometimes there may be more than 100% cases, most of which is caused by rounding during computing. However, if it is a disk array or another multi-disk system, it has the capability of concurrent I/O operations, more than 100% may also occur.

Svctm is the average service time of each request. From the source code, we can see that (r/s + w/s) * (svctm/1000) = util. For example, if util reaches 100%, then svctm = 1000/(r/s + w/s). Suppose IOPS is 1000, then svctm is about 1 ms, if the value is greater than this value for a long time, the system is faulty. However, we have already said that util may be too large in multiple disk systems such as disk arrays, so svctm may also be too large.

Await is the average wait time for each request. This time includes the queue time and service time. That is to say, in general, await is larger than svctm, and the smaller the difference, the shorter the queue time, and the larger the difference, the longer the queue time, it indicates a problem with the system.

Avgqu-sz is the length of the average request queue. Undoubtedly, the shorter the queue length, the better.

Note: The svctm parameter will be deleted in a future version of iostat. For details, see the official documentation.

In addition, sometimes iostat will display some very outrageous results. For specific reasons, see the explanation provided by the official FAQ.

Original article: http://huoding.com/2011/07/13/91

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.