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 identify 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 accumulate disk requests.
Just like top, processes are sorted to the head of the list according to the volume of their I/O. This recipe will explain more about iotop, and how we can benefit from its functionality.