Wednesday, December 17, 2014

Calculating IOPS for a given HDD

Hard Disk Drives:

Hard disk drive will have movable mechanical components in the form of platters, spindle, Read/Write Heads and Actuator Arm.
The Arm will move the read write heads in the radial movement against the platter to read or write data in the form of magnetic bits.

HDD Performance:

HDD performance is based on Seek Time (T), Rotational Latency (L) and Internal data transfer time (X) Disk Service Time Ts = T+L+X.
Disk service time is also the time taken by the disk to server an I/O for a given block size.

Seek Time, Rotational Latency and internal data transfer rate are provided by HDD Manufacturer.

For instance take Seagate Cheetah 10K.6 FC Drive (ST3146807FC). The manufacturer provided below specifications.

Average Internal data transfer rate buffer to/from disc media: 66 Mbytes/Second
Disc Rotation Speed: 10,008 RPM
Average Seek Time: 5.2 ms

Now let us calculate Disk Service Time, IOPS.


Rotational Latency (L) : 2.99 ms
The Rotational Latency is nothing but time taken for single rotation.
It can be calculated using given Disc Rotation Speed. Given speed is 10008 RPM. Per second it will come 166.8 RPS.
Because actuator arm occupies only half of the platter, we need to take half of the rotational speed only to calculate Rotational Latency.
Thus rotational latency will be 0.5/166.8 = 2.99 ms.


Seek Time (T) : 5.2 ms
Is the time it takes to place the read/write head on the target sector.

Internal data transfer time (X): 0.9 ms
Is the time read/write head takes to do read/write operation on the located sector.
Now let us calculate the internal data transfer time it takes for an I/O size of 64 KB.
As per vendor specifications, the internal transfer rate is 66 MB/s, so now the time taken by read/write head to do an I/O operation for 64 KB size IO is: 64 KB/66MBps= 0.9 ms
So in 0.9 ms it can read/write 64 KB from/to the disc.

Now the total time taken by disc to read/write an IO (with 64 KB Block size) is Ts= 5.2+2.99+0.9 = 9.09 ms

So finally the disc needs 9.09 ms to read/write an IO from/to buffer.

If it can do single I/O operation in 9.09 ms, how many I/O operations can do in a second ?
IOPS = 1/Ts = 1/9.09*10^-3 = 110

Now we know the disk service time (Ts) and IOPS the disk can give. But what will be application response time (R) for an IO.

The IO response time for an application depends up on Disk Service Time (Ts) and the controller Utilization.

R = Ts/(1-U)

If the controller utilization is more i.e if it reaches 100% the response time will be infinite.
If the controller is lower utilized the IOPS of the disk will be reduced.
To calculate application storage requirement, both capacity and performance need to be considered.

The number of disks required for an application will be calculated using below formula.

Dr = Max (Dc, Di)
Dr = the number of disks required
Dc= the number of disks required to meet the capacity
Di= the number of disks required to meet the application IOPS.


No comments: