Recent Blogs‎ > ‎

Understanding IOPS, Latency and storage performance

posted Jun 21, 2018, 2:23 AM by Karthik Karuppasamy   [ updated Jun 21, 2018, 2:45 AM ]
How much throughput can this drive deliver? You might have come across this question often, if you are in the storage field. Let’s unravel the most common terms like Throughput, IOPS & Latency in this blog. Normally throughput is represented in Megabytes/Seconds i.e. MB/s. Higher throughput ensures better performance and getting maximum value is depend lot of factors.
Before swim into the deeper part, let’s start with simple stuffs. 

Below diagram provides the 2D representation of the single disk plate in the Hard Drive. Disk plate have been divided in to tracks and each track is segregated to sectors. Data to be read/written i.e. IO will be stored in this sectors in binary format.
One sector can have Maximum “512 Bytes” of data. Hence IOPS [Input Output Per Second] means amount of read or write can be performed in one second on the sectors.
In real time, the application or service will not request IO from only one sector but will request for certain amount of IO from the disk [E.g. 4KB,8KB]. This IO size will differ based on the application and operating system as well. Hence IO Size means a certain amount of data to be read/written at the same time in disk.
So Throughput can be changed based on IOPS and Size of IO too. Throughput in MB/s = IOPS * Average IO Size.
What is Latency then?? Average Latency means average time taken to complete the each IO request. It has to be considered from application point of view]. 

Let us understand this term using real time example. Assume you are going to hospital for the health check up and the doctor takes approximately 15 minutes to complete the check up for one patient. Hence for an hour, we can assume that doctor (disk) can complete the check up for four patients (IOs) in average of 15 minute per person (Avg. Latency). It is clear that although the doctor can complete the check up for four persons in an hour, he can't handle them in same time rather. But if the second patient comes in 10 th minute, then his overall check up time will become 20 minutes which includes 5 minutes of waiting time. Hence "average latency" is always considered for representation. 

Normally latency is denoted in milliseconds (ms). We can easily understand from above example that the average latency should be minimal for better performance. In real world, this latency can be affected by several factors, especially traditional hard disk physical limits due to its mechanical construction. SAS Hard disk is having 10K or 15K RPM and SATA is having 5400 or 7200 RPM.
What is RPM? RPM is Revolutions per Minute or Rotational Per Minute. i.e. How many times the disk plate rotates in a minute. If the RPM value is high, the disk will provide high performance.
Lets take SAS drive which has 10000 RPM. Hence the plate will rotate 167 times for one second. To make it in different terms, plate will take 6 milliseconds to complete one full rotation. This is so called “Rotational Delay”

In the diagram, red dotted path represents the disk plate rotational movement [Anti Clock Wise] and blue dot represents the “disk arm and head” movement [to and fro]. Data can be read/written at any sector of any track and Disk head has to wait until the disk rotates to particular sector. In the diagram, in order to read the blue sector, disk has to rotate and disk arm & head also have to move outer part of the disk. 

The time it takes to move the disk arm & head is called “Seek Time”. If the average seek time is minimal for the disk then the disk arm & head movement is fast enough. 

If the IO size is 512 bytes, then reading of that one sector is enough [ one sector = 512 bytes]. But in real time, the IO size could be 4KB, 8KB and eventually we need to read more sectors. If the upcoming sector is also having our required data, then the disk plate movement is very very less and there is no movement for disk arm & head. But the fact is, the required data could present at any sectors of any track. Hence disk plate and head have to move continuously until the IO size is completed.
The amount of time taken to read/write the requested IO Size is called Transfer Delay. This transfer delay will be less if IO type is sequential. For Random IOs, requested data will be scattered all over the disk and hence transfer delay will be high.
So far we have checked some physical factors which decide the disk performance. To summarize everything, Throughput (MB/S) is based on the IOSize * IOPS. For the throughput of 150 MB/s with IO size of 4KB, we can achieve IOPS count of 36650. But for the same throughput 150 MB/s with the IO size of 32KB, we can only get IOPS count of 4580. One vital point we didn’t mention here. Guessed what? Yes, it is IO Type and these numbers for sequential IO. If it is Random IO then IOPS count will drastically reduce due to the physical factors what we discussed earlier.
So the thumb rule is: Only IOPS numbers are meaningless unless until other factors latency, IOSize , IOtype & Read/Write % are mentioned along with that.
Finally, to get better performance, go for the disks with High RPM and less average seek time. Also to improve the performance with Random IOs, we can go for RAID Management which could serve multiple IOs in parallel. 

Please do comment and share your thoughts if I have missed something.