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 sorted to the head of the list according to the volume of their I/O. 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. Be ready with the sudo
command...