Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use iostat

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to use iostat. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Analysis of iostat results

[root@20081006-1724 ~] # iostat-x

Linux 2.6.9-78.ELsmp (20081006-1724) 11 Universe 20 Universe 2009

Avg-cpu:% user% nice% sys iowait% idle

0.19 0.00 0.04 0.03 99.73

Device: rrqm/s wrqm/s rUnip s wdeband s rsec/s wsec/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm% util

Sda 0.05 17.60 1.46 7.72 80.69 202.57 40.34 101.29 30.87 0.01 1.06 0.37 0.34

Sda1 0.00 0.00 0.00 29.90 0.00 3.14 3.14 0.00

Sda2 0.00 0.00 0.00 16.25 0.00 1.51 1.30 0.00

Sda3 0.05 17.60 1.46 7.72 80.69 202.57 40.34 101.29 30.87 0.01 1.06 0.37 0.34

Dm-0 0.00 0.00 1.46 25.28 80.32 202.26 40.16 101.13 10.57 0.36 13.56 0.13 0.34

Dm-1 0.00 0.00 0.05 0.04 0.37 0.32 0.18 0.16 8.00 0.00 6.84 1.30 0.01

Rrqm/s: the number of merge reads per second. Namely delta (rmerge) / s

Wrqm/s: the number of merge writes per second. Namely delta (wmerge) / s

Rdyne s: the number of times the read of the Iripple O device was completed per second. Namely delta (rio) / s

Wthumb s: the number of writes completed by the I _ swap O device per second. Namely delta (wio) / s

Rsec/s: read sectors per second. Namely delta (rsect) / s

Wsec/s: the number of sectors written per second. Namely delta (wsect) / s

RkB/s: read K bytes per second. Is half the rsect/s because the size of each sector is 512 bytes.

WkB/s: write K bytes per second. It's half of wsect/s.

Avgrq-sz: the average data size (sector) per device Istroke O operation. That is, delta (rsect+wsect) / delta (rio+wio)

Avgqu-sz: average Imax O queue length. That's delta (aveq) / aveq 1000 (because it's in milliseconds).

Await: the average wait time (in milliseconds) for each device Istroke O operation. That is, delta (ruse+wuse) / delta (rio+wio)

Svctm: the average service time (in milliseconds) for each device Istroke O operation. That is, delta (use) / delta (rio+wio)

% util: how many percent of the time in a second is spent on the Imax O operation, or how much time in a second the Ipicuro queue is not empty.

That is, delta (use) / use 1000 (because it is in milliseconds)

If% util is close to 100%, it means that too many requests have been generated and the system is fully loaded. The disk

There may be bottlenecks.

More important parameters

% util: how many percent of the time in a second is spent on the Imax O operation, or how much time in a second when the Ipicuro queue is not empty

Svctm: the average service time for each device Istroke O operation

Await: average waiting time for each device Istroke O operation

Avgqu-sz: average Imax O queue length

If% util is close to 100%, it means that there are too many wait requests, the system is fully loaded, and there may be bottlenecks on the disk. Generally, when% util is greater than 70%, the pressure is higher, and the read speed has more wait. At the same time, you can check parameter b (number of processes waiting for resources) and wa parameter (percentage of CPU time spent by IO waiting) in conjunction with vmstat. IO pressure is high when it is higher than 30%.

The size of the await generally depends on the service time (svctm) as well as the length of the Imax O queue and the mode in which the Imax O request is issued. If the svctm is close to the await, it means that there is almost no waiting time for the await. If the svctm is much larger, the queue is too long and the response time of the application becomes slower.

The metaphor of image

R/s+w/s is similar to the total number of payers

The average queue length (avgqu-sz) is similar to the average number of people in queue per unit time.

The average service time (svctm) is similar to the cashier's speed of collection.

The average waiting time (await) is similar to the average waiting time per person.

The average avgrq-sz is similar to what the average person buys.

The% util is similar to the percentage of time someone queued in front of the cashier.

IO operation of the device: total IO (io) / s = r io s (read) + w max s (write) = 1.46 + 25.28mm 26.74

On average, it takes only 0.36 milliseconds for each device Icano operation to complete, but now it takes 10.57 milliseconds to complete, because there are too many requests (26.74 requests per second). If the requests are sent at the same time, the average waiting time can be calculated as follows:

Average wait time = time for a single Ithumb O server * (1 / 2 requests. + Total requests-1) / total requests

There are many Iamp 0 requests per second, but the average queue is 4, indicating that these requests are more uniform and most of them are processed in a timely manner.

Svctm is generally less than await (because the waiting time of requests waiting at the same time is double-counted)

The size of svctm is generally related to disk performance, and the load of CPU/ memory will also affect it. There are too many requests.

It will also indirectly lead to the increase of svctm. The size of the await generally depends on the service time (svctm) and

The length of the Ithumb O queue and the mode in which the Ithumb O request was issued. If svctm is closer to await, it means

If await is much larger than svctm, it means that the queue is too long.

The resulting response time becomes slower, and if the response time exceeds the range allowed by the user, you can consider

Replace faster disks, adjust kernel elevator algorithms, optimize applications, or upgrade CPU.

Queue length (avgqu-sz) can also be used as an indicator of system Imax O load, but because avgqu-sz is

According to the average value per unit time, it can not reflect the instantaneous Icano flood.

When using iostat to view the disk io status, the Device column shows multiple dm-xxx, but does not know the specific device path.

This is the end of the article on "how to use iostat". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report