Tracking I/O-heavy processes with iotop
Many DBAs and system administrators are familiar with the top
command, which displays the processes that use the most CPU or RAM. However, this does not help us find the processes that cause high amounts of system I/O.
Fortunately, there is a command, much like top
, that is designed specifically for displaying the processes that make storage requests. The iotop
utility displays a continuously updated list of the processes and any I/O they are handling. Provided that the server is dedicated to PostgreSQL, we can use this information to almost instantly identify one or more database backends that make disk requests.
Just like top
, processes are only sorted to the head of the list as long as their I/O continues to limit its long-term usefulness. Let's learn more about iotop
and see if we can benefit from its functionality.
Getting ready
The iotop
command can only be executed by root-level users, as it uses some kernel resources available only to superusers...