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 parse linux IO

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is to share with you about how to analyze linux IO, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

IOSTAT is easy to be misread

-because / proc/diskstats does not separate queue wait time from hard disk processing time, it is impossible for any tool based on it to provide values related to disk service time and queue, respectively

-iostat is calculated on the basis of / proc/diskstats

-the average elapsed time of each iThano is expressed in await, but it does not reflect the performance of the hard disk device, because await includes not only the time that the hard disk device processes the iMacro O, but also the time waiting in the queue.

-% util: the busy ratio of the hard disk device = [Δ io_ticks/ delta t], indicating that the device has a ratio of time when it is not idle, regardless of the number of it, only whether there is one. Too high may all be sequential IO

-% iowait indicates that a few percent of the time in a sampling period falls into the following situations: CPU is idle and there are still outstanding IBO requests

Pidstat calculates the increment per unit time of the process

Iotop to observe the dynamic iBandO of the process

Using BLKTRACE to analyze IO performance

To use blktrace, you need to mount debugfs:

$mount-t debugfs debugfs / sys/kernel/debug

Use blktrace to record the data in a file, the default output file name is sdb.blktrace., each CPU corresponding to a file. You can also specify your own output file name with the-o parameter.

$blktrace-d / dev/sdb

Use btt to analyze blktrace data. Btt is a tool for automatic analysis of blktrace data.

Btt cannot analyze real-time data, so it can only analyze the data files saved by blktrace. How to use it:

Merge the files that were originally saved separately as CPU into one, and the merged file is called sdb.blktrace.bin:

$blkparse-I sdb-d sdb.blktrace.bin

Execute btt to analyze the sdb.blktrace.bin:

$btt-I sdb.blktrace.bin

We see that 93.7461% of the time is spent on D2C, that is, the hardware layer, which is normal. We said that D2C is a measure of hardware performance.

Here a single IO averages 0.129201 milliseconds, which is already quite fast, and the slowest single IO is 14.246176 milliseconds, which is not bad. Both Q2G and G2I are very small and completely normal.

I2D is slightly larger and should be caused by cfq scheduler's scheduling strategy. You can try other scheduler, such as deadline, compare the differences between the two, and then choose the one that best suits your application characteristics.

The above is how to analyze linux IO, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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

Servers

Wechat

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

12
Report