Collecting Basic IO Statistics and Average Disk Activity

This article will help you collect IO statistics to determine how active your disks are. This can help you determine feasibility of WAN replication using DRBD Proxy.

A full week of iostat data should provide a good sample:

 # iostat -m 60 10080 -t -y > ~/iostat.rpt

Then get the average (grep for backing, ‘dm-7’ in this case):

$ count=0; total=0; for i in $(grep dm-7 ~/iostat.rpt | awk '{ print $4; }'); do
total=$(echo $total+$i | bc ); ((count++)); done; echo "scale=2; $total / $count" | bc


Another example for collecting and calculating averages using awk:

#  iostat -xymt dm-7 300 288 > ~/iostat.rpt

We can then awk that file to get us the average write throughtput for the sample period like so:

# grep dm-0 /tmp/iostat-output.txtt | awk '$1 {sum += $7} END {print sum / NR}'

If the average write throughput is far greater than your average WAN network throughput, then you might not be able to utilize DRBD® and DRBD Proxy for DR (disaster recovery) replication offsite. 

Reviewed 2020/12/01 – DGT