Posts Tagged 'systat'

Displaying Disc Utilisation Information

Most Linux distributions come with a handy package called sysstat which is a collection of several different performance monitoring tools. To find processes which are consuming a lot of hard disc performance use pidstat:

 pidstat -dw

This will give you a list of all processes and their task switching activity (-w) which will include voluntary and non-voluntary context switches. Optionally you can also get I/O statistics (-d). Now look at the process you suspect to use much of the hard disc performance (i.e. grep for mysqld). A high number of voluntary context switches means, that the program waits for data to write or read (this includes all kind of data, also network data, so don’t misinterpret the numbers). If a process is constantly tries to write data to the hard disc but has a lot of voluntary context switches, the hard disc is probably overstressed which blocks the process and makes the scheduler switching to another application.
To see a summary of all I/O utilisation use:

  iostat -dmx 5

This will print every five seconds an extended (-x) utilisation statistic in megabytes (-m) about the current hard disc usage (-d). Look for the r/s or w/s column to figure out how much megabytes are read from/written to the disk per seconds.