iostat is command for monitoring devices (Hard Drives)
attached to the system. This is another
tool I feel a little foolish for just discovering.
I recently was tasked with making an RDS amazon server with
a set IOPS on its hard drive. AWS offers
guaranteed IOPS speed for a higher price.
It’s a very useful feature to guarantee speed on your Database.
I wanted to test our current "Live" database to
see what IOPS it is currently using. I
found a few calculator sites out there to figure out our theoretical IOPS on
the database server such as
http://wintelguy.com/raidperf.pl
[2]. We got an estimate of ~400
IOPS. This number made me feel good,
since the smallest IOPS you can buy on AWS is 1,000 and increment by 1,000.
This estimated rate is not the actual live rate,
just an estimate of capacity. I wanted
to see what the actual rate we were using is.
iostat command
The iostat command is no longer installed by default on
Ubuntu (my linux flavor of choice).
To install it run
> sudo apt-get install sysstat
|
Run the iostat command and read it
These stats show the statistics since start up.
The tps = IOPS.
Since this machine was rebooted (many many months ago it has averaged
247 IOPS real usage)
What if I want to see more recent statistics?
Here is a command I ran
What this says is "-d" only display utilization
report
"-m" says convert read/write to MiB
The next number, in this case 10, is the interval to look
at. 10 is 10 seconds.
The final number, in this case 3, is the count number. Check 3 times.
So If I run this command I will see something like this
The first number displayed is the average since the server was
last started. The following number is
the average over 10 seconds.
If I leave off the last number and run
iostat will just continue to get the results every 10
seconds.
References
[1] Wikipedia IOPS page
Accessed
01/2014
[2] Raid Performance Calculator
Accessed
01/2014
[3] Monitoring IO Performance using iostat
& pt-diskstats
Accessed 01/2014