Disk load and IO wait on linux

Using the top command, you can find out how much time your processor spends waiting for input and output from disk, the IO wait field, but how can we know what applications are responsible for that IO wait.

to examin disk io and iowait more closely, we need some tools, the following is a list of tools that can show you exactly what is causing all the IO wait so that you can start from there.

Sometimes, apps that use the disk with many random reads should go to the secondary disk. but to find that application, take a look at the following tools, i will be explaining each and every one of them as we go.

Here are a bunch of programs on linux that will tell you just that

  • iotop – apt-get install iotop – simple top-like I/O monitor
  • iostat – apt-get install sysstat – shows and monitors activity per disk – The sysstat package contains the sar, mpstat and iostat commands for Linux.
  • isag – apt-get install isag – Interactive System Activity Grapher for sysstat
  • dstat – apt-get install dstat – versatile resource statistics tool
  • vmstat 1
  • iostat 1
  • lsof
  • strace -e trace=open
  • strace -e trace=open -p
  • In ps auxf you’ll also see which processes are are in uninterruptible disk sleep (D) because they are waiting for I/O.
  • fatrace – Amazing tool showing you which files are being accessed or written on the hard drive

examples

iostat -c -d -x -t 2 100

Leave a Reply

Your email address will not be published. Required fields are marked *