HOW TO MONITOR DISK I/O IN LINUX FROM COMMAND LINE
If yourÂ LinuxÂ system gets slow down due to heavyÂ diskÂ I/O activities, you probably want to know which processes or users (in case of multi-user systems) are the culprit for such activities. You may also wish toÂ monitorÂ diskÂ I/O trending over time as part of dailyÂ Linux system administration. Here I will introduce severalÂ diskÂ I/O monitoring tools on Linux.
Monitor disk I/O on per-process basis
If you want to monitor disk I/O activities of individual Linux processes, you can tryÂ iotop. This tool shows a sorted list of the most I/O intensive processes in real time viaÂ top-like interface.
To installÂ iotopÂ on Fedora, run:
To monitor disk I/O withÂ iotop:
RunningÂ iotopÂ without any argument like above shows a list ofÂ allÂ existing processes regardless of their disk I/O activities. If you wantÂ iotopÂ to only show processes that are actually doing disk I/O, run the following instead.
Monitor disk I/O on per-disk basis
If you are interested in monitoring disk read/write rates of individualÂ disks, you can useÂ iostat. To use this tool, you need to runÂ sysstatÂ package.
To installÂ sysstatÂ on Ubuntu or Debian:
To installÂ sysstatÂ on CentOS, RHEL or Fedora:
To monitor disk I/O of individual disks withÂ iostat:
Linux 3.2.0-29-generic-pae (my_host) 04/06/2013 _i686_ (2 CPU) avg-cpu: %user %nice %system %iowait %steal %idle 2.11 0.08 3.20 3.65 0.00 90.96 Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn sda 55.77 1403.98 2138.71 4139635 6306020