3
头图

Tool Preparation:

iotop: http://guichaz.free.fr/iotop/

pt-ioprofile: http://www.percona.com/downloads/percona-toolkit/2.2.1/

IO High Analysis Method:

1. View disk usage df -lh

2. Install iostat Installation command: yum install sysstat

3. iostat -d -k 2 to view the IO situation:

Which disk has a higher IO load, then let's locate the specific load source
在这里插入图片描述
%util: Percent of a second for I/O operations, or how much of a second the I/O queue is non-empty. That is, delta(use)/s/1000 (because the unit of use is milliseconds)

If %util is close to 100%, it means that there are too many I/O requests, the I/O system is fully loaded, and the disk may have a bottleneck.
在这里插入图片描述
4. Install the iotop command:

Installation command: yum install iotop iotop Check which thread consumes more IO, press o to display only the processes with disk IO activity.
在这里插入图片描述
5. pt-ioprofile locates the load source file

pt-ioprofile --profile-pid=1236 --cell=sizes

The principle of pt-ioprofile is to attach a strace process to a pid for IO analysis.
在这里插入图片描述

6. For positioning problems, it is more useful to locate by IO throughput. Use the parameter --cell=sizes, which displays the results in B/s

pt-ioprofile --profile-pid=1236 --cell=sizes

As can be seen from the above figure, the main source of IO load is jetty.

And the pressure is mostly on reading.

Source | https://urlify.cn/JNRVJb


码农突围
150 声望17 粉丝

分享音视频、Python、Java等技术,15万程序员的成长充电站。