Where does iostat obtain IO-related information?

Source: Internet
Author: User
Tips: Do you know where iostat gets IO-related information? Use the strace command to find the answer: shell & gt; strace-eopeniostatopen (& quot;/proc/diskstats & quot;, O_RDONLY). note: about diskstats, see the official documentation (field1 ~ Fie...

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

Shell> strace-eopen iostat
Open ("/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 1
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s
Sda 0.18 37.71 0.65 2.63 50.18
Avgrq-sz avgqu-sz await svctm % util
113.46 0.35 107.49 1.67 0.55

Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s
Sda 0.00 4208.00 0.00 165.00 0.00
Avgrq-sz avgqu-sz await svctm % util
993.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.

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 in the queue per second
# 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 in computing.

Svctm is the average service time of each request. Here is a formula: (r/s + w/s) * (svctm/1000) = util. For example, if util reaches 100%, then svctm = 1000/(r/s + w/s). if IOPS is 1000, the svctm is about 1 ms, if the value is greater than this value for a long time, the system is faulty.

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. the smaller the difference, the shorter the queue time. Otherwise, the larger the difference, the longer the queue time, indicates that the system is faulty.

Avgqu-sz is the length of the average request queue. Without a doubt, the shorter the queue length, the better.

Reminder: For RAID and other multi-disk systems, the reference value of iostat results may change. we recommend that you check the relevant information.

Author: LIMIMGJIE"
 

Related Article

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.