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

What is the method of Linux to find the process that occupies a lot of disk IO to read and write?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article analyzes "what is the Linux search process method that takes up disk IO to read and write very high". The content is detailed and easy to understand, the "Linux search disk IO read and write high process method is what" interested friends can follow the editor's ideas slowly in-depth reading, I hope that after reading can be helpful to everyone. Let's follow the editor to learn more about "what is the process method of Linux search that takes up disk IO to read and write".

An online server alarms, disk utilization disk.util > 90, and continuous alarm. After logging in to the server, use iostat-x 1 10 to view relevant disk usage information.

The relevant screenshots are as follows: view relevant disk usage information through iostat-x 1 10

1 # if there is no iostat command, use yum install sysstat to install 2 # iostat-x 1 10

As can be seen from the above figure, the% util [IO] of vdb disk is almost 100%, which is caused by frequent data reading.

Other field description

Device: device name tps: the number of IO read and write requests per second. Multiple logical requests can be combined into a single IO O request to the device. Blk_read/s (kB_read/s, MB_read/s): the amount of data read from a device, expressed in blocks (kilobytes, megabytes) per second. The block is equivalent to a sector, so the block size is 512 bytes. Blk_wrtn/s (kB_wrtn/s, MB_wrtn/s): the amount of data written to the device, expressed in blocks (kilobytes, megabytes) per second. The block is equivalent to a sector, so the block size is 512 bytes. Blk_read (kB_read, MB_read): the total number of read blocks (kilobytes, megabytes). Blk_wrtn (kB_wrtn, MB_wrtn): the total number of blocks written (kilobytes, megabytes). Rrqm/s: the number of read requests merged into the device per second. That is, delta (rmerge) / swrqm/s: the number of write requests merged into the device per second. That is, delta (wmerge) / sr/s: the number of times the read of the I _ max O device is completed per second. That is, delta (rio) / sw/s: the number of times the write I _ love 0 device has been completed per second. That is, delta (wio) / srsec/s (rkB/s, rMB/s): read the number of sectors (kilobytes, megabytes) of the device per second. Each sector size is 512 bytes wsec/s (wkB/s, wMB/s): the number of sectors written to the device per second (kilobytes, megabytes). The size of each sector is 512byte avgrq-sz: the average amount of data (in sectors) of each device Ipicuro operation. That is, delta (rsec+wsec) / delta (rio+wio) avgqu-sz: the average Imax O queue length sent to the device each time. Await: average waiting time per IO request. (including waiting queue time and processing time in milliseconds) r_await: average wait time per IO read request. (including waiting queue time and processing time in milliseconds) w_await: average wait time per IO write request. (including waiting queue time and processing time in milliseconds) svctm: the average processing time (in milliseconds) for each device Imax O operation. Warning! Don't trust this field value any more, it will be deleted in future sysstat versions. % 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. When the value is close to 100%, device saturation occurs.

Find processes with high IO usage

Through the iotop command

If you do not have this command, install it through yum install iotop.

# iotop-oP

Through this command, you can see more detailed information, such as: process number, disk read, disk write, IO percentage, and what the command involved is. "both are caused by grep commands."

Through the pidstat command

The meaning of the 1 # command: show the statistics of pidstat O, update 2 # command-d 1 every second.

It can be seen that the grep command takes up a lot of read IO, and then you can view the relevant process information according to the PID.

About Linux search disk IO read and write high process method is shared here, I hope that the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!

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