Calculating Disk IOPs on Linux
Calculating Disk IOPs on Linux
by Jeff on June 6th, 2014 No Comments »
 , , ,

Restored!
Original Publish Date - December 23, 2011

I’ve recently been playing around with Zabbix monitoring solution to replace Icinga. I really wanted to find a solution to monitor the IOPs on my Linux servers, all of which are virtualized on Citrix Xen Server. I have some test servers connected to an HP StorageWorks NAS and wanted to see the IOPs I was achieving.

For starters, IOPs refers to Input/Output Operations Per Seconds. Basically (reads + writes) = IOPS. Some companies may use the term TPS (transactions per second). These are typically the same thing.

Most Linux distrobutions offer a package called ‘iostat’. I am using CentOS 4, 5 and 6. On CentOS the package is called sysstat and can be installed by issuing the following command
[bash]
yum install sysstat
[/bash]
Sysstats is not an actual command, it’s a package. You cannot run sysstats from the CLI. To check the current IOPs, issue the following command
[bash]
[[email protected]]# iostat
avg-cpu: %user %nice %sys %iowait %idle
9.66 0.09 2.57 0.15 87.53

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 10.23 7.23 84.55 274351120 3210250090
sda1 0.00 0.00 0.00 10994 210
sda2 10.23 7.23 84.55 274329694 3210249880
dm-0 40.34 7.22 84.53 273979282 3209533152
dm-1 0.00 0.01 0.02 350128 716728
[/bash]
A general rule of thumb on IOPs is as follows:

7.2k RPM -> ~100 IOPS
10k RPM -> ~150 IOPS
15k RPM -> ~200 IOPS

This applies to single spinning disks (No RAID, No SSD). Of course SAS and SSD drives will perform better than SATA. These numbers are simply a guideline.

My example above was ran against a VMWARE Guest. VMWare was configured to use local disks (15k RPM SAS). I’ll try running this against my Xen Servers using iSCSI connection to the HP StorageWorks NAS (Not a SAN). The StorageWorks also contains 15k RPM SAS drives in a RAID 5.
[bash]
[[email protected]]# iostat
avg-cpu: %user %nice %system %iowait %steal %idle
1.41 0.10 0.36 0.76 0.01 97.36

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
xvda 140.14 134.92 2139.67 20248230 321123158
xvda1 0.00 0.01 0.00 2218 30
xvda2 140.14 134.90 2139.67 20245860 321123128
xvdd 0.00 0.00 0.00 544 0
dm-0 271.03 129.45 2132.64 19428290 320067224
dm-1 1.56 5.45 7.04 817248 1055904
[/bash]
Much better. Now to investigate why the VMWare box is performing so poorly.


Leave a Reply

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