If you're reading this article, you likely have diagnosed high load on your server caused by high IOwait. You may have been led here after reading How to diagnose high loads with the "iostat" command.
Iostat is excellent in determining whether you have high IO and on a system level, what is causing it (read or writes?), but it can't tell you what user or process is contributing to the IO usage.
Iotop fills in the gap. In short, iotop shows the process ID, user, the disk read, the disk write, the swap usage, the percent IO, and the command for each process.
Iotop is not installed by default on a lot of systems, so make sure it is installed:
yum -y install iotop
iotop can be run by itself, or with options found in its man page. The following example runs iotop in a non-interactive mode. It runs once and only shows processes that are using IO:
root@server [~] # iotop -b -n 1 -o
Total DISK READ : 0.00 B/s | Total DISK WRITE : 24.60 M/s
Actual DISK READ: 0.00 B/s | Actual DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
1631 be/4 phil 0.00 B/s 24.60 M/s 0.00 % 12.00 % yes
As you can see from the example, the user "phil" is running the command "yes," which is using a large amount of IO to write to the disk. You can find the process in the output of the command "ps fauxww" as well (or in top):
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
phil 1631 101 0.0 108056 356 pts/1 R+ 10:37 0:09 \_ yes
To actively monitor IO, like with top, just run "iotop":
The next course of action on addressing the process utilizing high IO depends on the type of service or command it is. A resolution can range anywhere from optimizing the process to use fewer resources or, killing the process if it's no longer needed.
If you're unsure of how to proceed with addressing the process, you may benefit from contacting a system administrator for further investigation. If you do not have such an administrator, you may search for one in our listings here:
However, please note that cPanel, LLC does not endorse or recommend any particular provider on that list, nor can we be held liable for any services performed by third-party providers, including those on the list.
You may also want to review the following article: What is considered high I/O?