Pages

Saturday 28 March 2020

Understanding Disk Performance and IOPS in cloud platform

In the past many years, apart from working as DBA, I was working with multiple cloud technologies and actively involved in the migration process to cloud infrastructure. In between, I managed to get certified in AWS as Associate Solution Architect.

While working with database operation in the cloud,  the most challenging part was to understand the Storage/disk performance. In this post, we will discuss the IOPS and disk performance in both AWS and Azure platforms.

Before jumping into that, let us understand the size of the IO, This depends on two factors. The Allocation unit size of the disk and application requesting the IO operation. If the application IO request size is more than the size of the Allocation Unit Size (Block Size), OS split the IO request into smaller IO operations. For example, if an application requesting to open 10MB file residing in a disk with an allocation block size of 64 KB, the request will get divided into 160 requests with a size of 64KB (10 MB=10240 kb/64kb =160 IO operation). If the block size of the disk is 8 KB, this requires 1280 IO operations. To identify the Allocation Unit Size of the existing disk, run the below command from the command prompt  From the result look for Bytes Per Cluster, which is the allocation unit size of the disk. This is the value you set while formatting the drive.

C:\>fsutil fsinfo ntfsinfo D:  (Where D stands for the drive letter of your drive)

Now let us understand the concepts of IOPS and throughput. Let us assume we have a disk that supports 3000 IOPS with an allocation unit size of 64KB.  The maximum throughput of the disk is 

Throughput of the disk = 3000 IOPS X 64KB (size of the IO) = 192000KB =187.5 MB . 

As the IOPS is IO per second, throughput is  187.5 MB/sec. Whether the disk can achieve this max throughput limits depends on the application requesting for the IO operation. If the application request comes with smaller than the size of the Allocation unit size, we can't make use of the max throughput of the disk. Let us take an example of the application requesting for IO operation with the size of 8KB, then max throughput will be :

Throughput of the disk = 3000 IOPS X 4KB (size of the IO Operation) = 24000KB =23.44 MB/sec 

Let us keep these three points in mind while discussing further the performance of the disks in the cloud environment. The performance of the disks is controlled by IOPS and throughput limits. These limits are there in both disk and instance (VM) level. 

Before going into more detail, let us look into the different types of disk available on both platforms.
AWS, provide two major types of disks :
  • General Purpose SSD (gp2)
  • Provisioned IOPS SSD (io1
Apart from those, AWS provides a couple of other disk types that are not relevant for our discussion. gp2 disk comes with predefined IOPS based on the size of the disk. Amazon offers 3 IOPS per GB. A single volume can have a maximum of  16000  IOPS (16 Kib IO) and 250 Mib/s throughput based on the disk size.  To make it clear both 5.333 TB  (5333 GB * 3 IOPS=~16000) and 10 TB (10240 GB*3 IOPS=30720 =16000(max limit per volume) provides 16000 IOPS and maximum throughput od 250 Mib/s . If the maximum throughput is 250 Mib/s with 16000 IOPS, what is the IO size 

IO size = 250MB=(256000 KB) / 16000 IOPS =16 KB.

That tells us that one IO operation can read /write a maximum of 16KB. It is very important to look into the size of the IO disk supports while reading the IOPS parameter of the disk. Let us take the same example of opening a 10MB file that resides on disk with the allocation unit size of 64KB. In this case, it requires a 640 IO operation. If the same files reside in a disk with the allocation unit size of 4KB, then it requires 1280 IO Operation. So the number of IO operation requires to complete one IO request is =

                                      Size of the IO request  (in KB)                                                                       
MIN(size of the IO request, size of the IO supported by the disk, Allocation unit size of the disk)

In this :
size of the IO request: decided by the application design
size of the IO supported by the disk: decided by the manufacture (provider) of the disk
Allocation unit size of the disk: decided the by the user who is configuring the disk in VM

All these three plays a vital role in the performance of the disk.

With the provisioned IOPS (io1) disk, the user can define the IOPS of the disk. The user needs to pay an extra amount for the IOPS of the ioI disk, whereas this is included in the cost of the disk for gp2 disks. Io1 disk supports a maximum of 64000(16Kib I/O) IOPS and 1000MiB/s throughput. The maximum throughput is nothing but 64000*16=1024000KB=1000MiB.

Apart from this, instance(ec2) IOPS and throughput throttling comes into the picture and plays a role in the performance of the disk. For example, 13.xlarge support maximum throughput of 106.25Mib/s and 6000 IOPS. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html. If you attach a gp2 disk with the capacity of 5 TB to this instance, we will not able to make use of the maximum IOPS and throughput of the disk as throttling happen at the instance level. The disk can support 5TB=5120GBX3 IOPS =15360 IOPS and maximum throughput of 15360X16KB=240MiB/s but we will not get the full benefit of this due to throttling in the instance level. To get the maximum benefit of disk performance, we need to attach this disk to i3.4xlarge which supports a maximum throughput of 437.5MiB/s and 16000 IOPS.

I have tried my level best to explain the elements that affect the performance of the disks in cloud platform . Keep these points in mind while selecting the ec2 instances and disk for your workload. We will discuss further on the azure side in another blog post.







11 comments:

  1. Thanks for sharing valuable information. Any one interested to learn aws click here AWS Devops Training.

    ReplyDelete
  2. Your composing style says a great deal regarding what your identity is and as I would like to think, I'd need to state you're canny. This article reflects my very own large number contemplations regarding this matter. You are genuinely novel.


    Denial management software
    Denials management software
    Hospital denial management software
    Self Pay Medicaid Insurance Discovery
    Uninsured Medicaid Insurance Discovery
    Medical billing Denial Management Software
    Self Pay to Medicaid
    Charity Care Software
    Patient Payment Estimator
    Underpayment Analyzer
    Claim Status

    ReplyDelete
  3. افضل شركات نقل العفش في منطقة المدينة المنورة تلك الشركات التي تقدم افضل الخدمات الخاصة بالمنزل كما في افضل شركة نقل اثاث بالمدينه المنوره المضمونة وتلك الخدمات تكون بمنتهى الدقة والاحترافية وتمتلك سيارات مجهزة خصيصا لنقل العفش من مكان الى مكان آخر بعد تنظيف المكان الجديد من قبل ارخص شركات تنظيف شقق بالمدينة المنورة محترفة وذلك قبل نقل العفش اليها لكي يتم ترتيب عفشك على نظافة وقد تقوم في الحال اقوى شركات تنظيف الخزانات بالمدينه المنوره بتنظيف وتعقيم لخزان المياه خاصتك لضمان سلامة ونقاء مياهك وايضا تعمل افضل شركة تنظيف موكيت بالمدينه المنوره بتنظيف وغسيل المفروشات والكنب والموكيت والستائر وتعقيم المنزل كاملا وتقدم شركة مكافحة الصراصير بالمدينة المنورة خدمات رش المبيدات الحشرية لكي يتم تعقيم المنزل كاملا من البكتيريا والجراثيم الضارة

    ReplyDelete
  4. الرياض من اهم مناطق المملكة ولا بد ان تكون خدمات التنظيف ونقل الاثاث في الرياض على مستوى لائق باهل العاصمة ونقدم لكم اقوى شركات نقل العفش بالرياض المضمونة وتقدم خدمات رائعة وتستخدم سيارات نقل عفش مخصصة ومبطنة من الداخل وايضا تجد خدمات التنظيف للمنازل والفلل والشقق في افضل شركة تنظيف منازل بالرياض رخيصة وتمتلك خبرة طويلة في اعمال تنظيف الشقق والفلل والقصور وجلي وتلميع جميع انواع البلاط ونقدم ايضا خدمات تنظيف المنازل بالبخار في الرياض تحت اسم اكبر شركة تنظيف كنب بالرياض آمنة بهدف الحصول على تنظيف منزلي شامل للارضيات والشبابيك والمفروشات كالكنب والمجالس والموكيت والسجاد وقد تحتاج ايضا الى تنظيف خزان المياه خاصتك وذلك بالتعاقد مع ارخص شركه تنظيف خزانات بالرياض مجربة لخدمات تنظيف وتعقيم وصيانة لخزان الماء خاصتك وعمل تعقيم للخزان الأرضي والعلوي ولا بد ايضا ان تهتم بتنظيف المنزل من الحشرات مع افضل شركه مكافحه حشرات بالرياض مضمونة لتعقيم المنزل او المسجد والتخلص من الحشرات المزعجة كما في شركات مكافحة الحشرات بالرياض التي تقدم خدمات جيدة بالضمان

    ReplyDelete
  5. Nice blog..
    https://www.kitsonlinetrainings.com/course/linux-online-training

    ReplyDelete
  6. Obtaining a residence permit based on Latvian bank Investment and often the Superior option for those looking to obtain a residence permit while ensuring a stable investment with a guaranteed return, Instead of exposing themselves to the changing benefits of may be seen when investing in Real Estate. Statistics show that this type of investment and the less common method of obtaining a residence permit. making this the best choice for some investors solution. https://www.immigration-residency.eu/residence-permit-latvia/bank-deposit/

    ReplyDelete
  7. At Ace Capital groups, we are dedicated to provide financial advise to people who wants to invest their money on good returning products. We provide Wealth Management Goldcoast.

    ReplyDelete
  8. I'm impressed by the level of detail you've provided in this article. Thank you for sharing your expertise with us! best seo services in gwalior

    ReplyDelete
  9. This is excellent! Your observations are right on target, and the examples really help to solidify your points. Luxury Property in gwalior

    ReplyDelete