Monitor Disk I/O activity using IOTOP & IOSTAT commands
If your Linux box gets slow down, automatically our fingers types top command in terminal to check server load. If you don’t get any proper solution from top command output, then you can have a look into wa status because most of the time our server gets slow down due to heavy I/O Read and Write on hard disk. If its high, it could be a chance. So, we need to check I/O activity on hard drive. We can monitory I/O activity in linux box using iotop and iostat commands. Alternatively you Monitor system resources using HTop, SAR commands.
1) How to install iotop
Use the below command to install iotop in linux system. To install iotop to RHEL/Centos/Scientific Linux, probably you need to enable EPL or REPOFORGE or REMI repository because there is no official package on this.
# Install iotop on Ubuntu/Debian/LinuxMint # $ sudo apt-get install iotop # Install iotop on RHEL/Centos/SL/Fedora 21 & older systems # # yum install iotop # Install iotop on Fedora 22 & later systems # # dnf install iotop # Install iotop on openSUSE # # zypper install iotop
2) Monitor disk I/O on individual process
Use the iotop command to monitor disk I/O on individual process. This tool output smiler to top command. see the below screen shot of iotop output without any argument.
$ iotop -o
3) How to install iostat
Use the below command to install iostat in linux system. You have to install sysstat because iostat is part of sysstat package.
# Install iostat in Ubuntu/Debian/LinuxMint # $ sudo apt-get install sysstat # Install iostat on RHEL/Centos/SL/Fedora 21 & older systems # # yum install sysstat # Install iostat on Fedora 22 & later systems # # dnf install sysstat # Install iostat on openSUSE # # zypper install sysstat
To print individual hard disk I/O activity, use the iostat command with below option. It will print the output 5 second interval
$ iostat -dx 5 # Options # d : Display the Disk utilization x : Display extended statistics 5 : Interval in seconds
$ iostat -dpx 5 # Option # p : displays statistics of all partition