Publish: 2019-11-27 | Modify: 2019-11-27
iotop command is a top-like tool for monitoring disk I/O usage. It has a similar UI to top, including information such as PID, user, I/O, and processes. Most IO statistics tools for Linux, such as iostat and nmon, can only track read and write operations per device. If you want to know how each process is using IO, it can be tricky. Using the iotop command, you can easily view this information.
Copy the following command according to your system:
# Ubuntu/Debian
apt-get install iotop
# CentOS
yum install -y iotop
Enter iotop -h
to view the usage help.
-o: Show only processes with IO activity.
-b: Batch mode, no interaction, mainly used for logging to a file.
-n NUM: Display NUM times, mainly used for non-interactive mode.
-d SEC: Display every SEC seconds.
-p PID: Monitor the process with the specified PID.
-u USER: Monitor processes owned by the specified user.
-k: Use kilobytes instead of human-readable units.
Enter the command iotop -k
in the terminal to see the result as shown in the following image.
The iotop
command is very useful for identifying which process is using IO when troubleshooting disk read/write bottlenecks on a server. I recommend bookmarking it.
This article partially references: iotop command
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.