Skip to content

Instantly share code, notes, and snippets.

@rayhassan
Created May 11, 2017 13:37
Show Gist options
  • Save rayhassan/c5539b4b385f4c15be9c91c2258a84b8 to your computer and use it in GitHub Desktop.
Save rayhassan/c5539b4b385f4c15be9c91c2258a84b8 to your computer and use it in GitHub Desktop.
Calculating IOPS ....
IO Performance:
--------------
NCQ - Native Cmd Queueing - SATA II - 32 cmds
TCQ - Tagged Cmd Queuing - SCSI 2 - 216 cmds possible (64 cmds supported by most disk queues)
- Reordering of cmds when requests for sectors spaced far from one another.
- attempts to reduce disk seek time and rotation latency by optimising order in which sectors are found.
IOPs:
Based on rotational speed, average latency and seek times.
Ave IOPs = 1/(ave latency (in ms) + ave seek (in ms))
Rota­tional speed: 10,000 RPM
Average latency: 3 ms (0.003 seconds)
Average seek time: 4.2 (r) /4.7 (w) = 4.45 ms (0.0045 seconds)
Calcu­lated IOPS for this disk: 1/(0.003 + 0.0045) = about 133 IOPS
....but for the most part you can get by with commonly accepted averages. Of course sources vary .......
Rotational Speed (rpm) IOPS
5400 50 80
7200 75 100
10k 125 150
15k 175 210
Multidisk Sets:
--------------
RAID Penalty.....
RAID Level Read Write
RAID 0 1 1
RAID 1(and 10) 1 2
RAID 5 1 4
RAID 6 1 6
(Total Workload IOPS * Percentage of workload that is read operations) + (Total Workload IOPS * Percentage of workload that is read operations * RAID IO Penalty)
Source: http://www.yellow-bricks.com/2009/12/23/iops/
As an example, let's assume the following:
Total IOPS need: 250 IOPS
Read workload: 50%
Write workload: 50%
RAID level: 6 (IO penalty of 6)
(250 * 0.5) + (250 * 0.5 * 6)
125 + 125 * 6
125 + 750
Result: You would need an array that could support 875 IOPS to support a 250 IOPS RAID 6-based workload that is 50% writes.
- indicates that the number of disks might be more important than the size (i.e., you would need twelve 7,200 RPM, seven 10K RPM, or five 15K RPM disks to support this IOPS need).
d = num­ber of disks
dIOPS = IOPS per disk
%r = % of read workload
%w = % of write work­load
RF = raid factor (write operations column)
IOPS = d * dIOPS
-------------
%r + (RF * %w)
where am I sup­posed to get %read and %write from?
sar -d -p will report activ­ity for each block device and pretty print the device name.
%r = rd/s
-----------
rd/s + wr/s
%w = wr/s
-----------
rd/s + wr/s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment