Introduction
Most of the IO statistics tools under Linux, such as Iostat, Nmon, and so on, are only counted to the Per Device's read and write situations, and if you want to know how each process uses IO, it's a bit cumbersome.
Iotop is a top class tool used to monitor disk I/O usage. Iotop has a UI similar to top, which includes information about PID, user, I/O, process, and so on.
Example
Just run it straight.
Iotop
The output is as follows
Total DISK READ:6.01 m/s | Total DISK WRITE:3.85 k/s TID PRIO USER disk READ disk WRITE swapin io>COMMAND20074 be/4 Hadoop6.01 m/s0.00 B/S0.00%4.54% Java-dproc_datanode-xmx8192m-serverOrg.apache.hadoop.hdfs.server.datanode.DataNode6371 be/4 Hadoop0.00 B/S3.25 m/S0.00%0.00% Java-dproc_datanode-xmx8192m-serverOrg.apache.hadoop.hdfs.server.datanode.DataNode8497 be/4 hadoop 0.00 b/ s 3.67 m/s 0.00% 0.00% Java-dproc_datanode-xmx8192m-server Org.apache.hadoop.hdfs.server.datanode.DataNode 1 be/ 4 root 0.00 b/S 0.00 b/S Span style= "color: #800080;" >0.00% 0.00% init 2 be/< Span style= "color: #800080;" >4 root 0.00 b/S 0.00 b/S 0.00% [Kthreadd]
by outputting The result, we can clearly know what program is reading and writing disk, speed and command line, PID and other information.
Source: Linux Process Real-time IO monitoring iotop command detailed
Linux process Real-time IO monitoring iotop command detailed