This article is outdated and may not work correctly for current operating systems or software.
If you are a Linux system administrator, one of your common maintenance tasks is to quickly determining which processes consume large amounts of disk I/O before you can find a solution accordingly.
You can use iotop
to get this task done. Unlikeiostat
, which can only display the summary of disk I/O, iotop
can display the I/O usage of each process or thread. This will allow you to easily determine the most I/O consuming processes which are slowing down the system.
In this article, we will be covering the process of installing iotop
on a CentOS 6 x64 server instance.
Before further reading, you need to:
A Vultr instance running CentOS 6 x64.
A sudo user.
On CentOS 6, You can install iotop with the following command:
sudo yum install iotop
For security purposes, non-root users who don't own sudo privileges have been forbidden to launch the iotop utility. You must be the root or a sudo user before you can launch the iotop:
sudo iotop
The iotop
interface is rather intuitive. On the top of the screen, you can see the total disk read speed and the total disk write speed. then you can see a highlighted row of parameters explained as below:
PID: the process ID
PRIO: the I/O priority
USER: the user who is using the command
DISK READ: the disk output bandwidth
DISK WRITE: the disk input bandwidth
SWAPIN: the percentage of time the thread spent while swapping in
IO: the percentage of time the thread spent while waiting on I/O
COMMAND: the command name
Under the highlighted line, you can see all of the running processes in the system, sorted by one of the parameters mentioned above, one process a line.
You can use the following keys to control the display:
The left and right arrows: change the sorting column which by default is IO.
r: toggle the sorting order.
o: toggle between "only showing processes or threads actually doing I/O" and "showing them all".
p: toggle between "only showing processes, not all threads" and "showing processes and all threads".
a: toggle between "showing accumulated I/O" and "showing I/O bandwidth".
q: quit.
any another key: refresh.
This concludes our tutorial on how to install and use iotop
. Thank you for reading.