AWS EBS GP2 Volume Bursting using fio

As you maybe aware, there are four EBS volume types available in AWS.

  • 1. General Purpose SSD (GP2)
  • 2. Provisioned IOPS SSD (IO1)
  • 3. Throughput Optimized HDD (ST1)
  • 4. Cold HDD (SC1)

  • Each of these volume types has its own strengths and weaknesses. Out of the four volume types described, GP2 and IO1 are more catered towards IOPS-sensitive workloads. If you compare GP2 and IO1, Provisioned IOPS (IO1) is more seasoned for IOPS workloads and more powerful out of the two.

    However, if we are to test Burst Balance feature in this blog, we have to choose GP2 here. This is mainly because the Burst Balance feature is not available in IO1 and is only available with GP2.

    GP2 Volume Type


    GP2 Volumes have the following key features:

    Volume Size: 1 GB to 16TB (16,384 GB)

    Min IOPS/Volume: 100 (but bur-stable to 3000)

    Max IOPS/Volume: 16,000

    Number of IOPS per GB: 3



    If your EBS GP2 Volume storage is configured as 8GB, as in this example, the volume IOPS can be calculated as just 24 (3 * 8 GB).

    Though the calculation works out to 24, the minimum IOPS for a GP2 is 100 (see above default settings). However, with the EBS GP2 bursting feature, GP2 volumes can be burst up to 3000 IOPS (3 * 1000 GB) if required, without increasing the size of the volume (that is 8GB here). This is a really cool feature, which can handle sudden unpredictable EC2 workloads.

    Burst Balance


    Having said that, this feature is provided to each EBS GP2 volume as a point system, which is known as Burst Balance. Whenever you consume the EBS GP2 volume, you are basically consuming your earned Burst Balance points automatically. Whenever you are not utilizing them, the system tends to regain your points to the usual 100% mark allowing you to use it for another spike (see Figure 1).

    Using “fio” to Load the Instance

    The fio library [1] is a popular load test library, which is heavily used in Linux/ Unix environments. Since we consider Amazon Linux as our EC2 AMI, we are able to leverage the same library for our load testing as well.

    With this tool, you can configure the Read and Write (RW) loads in such a way to suit your requirement.

    Steps

    Lets try this and see now.

    Step 1 : Create an EC2 instance (Amazon Linux as OS) with an EBS volume (GP2) as the ROOT volume.

    Step 2 : Go to Volumes and select the Root Volume of the created EC2 instance.

    Click the Monitoring tab and you will get to see a set of graphs (see Figure 1) with various monitoring metrics. The Burst Balance metric is one of them. This metric shows you the current Burst Balance utilization of the selected EBS volume (see Figure 2).

    Step 3 : SSH into EC2 instance and install fio now.

    $ sudo yum install fio

    Step 4 : Lets add some load into the EC2 instance using fio by executing the following command.

    $ fio — randrepeat=1 — ioengine=libaio — direct=1 — gtod_reduce=1 — name=test — filename=random_read_write.fio — bs=4k — iodepth=64 — size=4G — readwrite=randrw — rwmixread=75

     

    The above will create a 4GB file, and perform 4KB reads and writes using three reads for every write ratio (75%/25%), as specified with option — rwmixread=75), split within the file, with 64 operations running at a time.

    The RW ratio can be adjusted for simulating various usage scenarios.

    The final results are as follows.

    Step 5 : Now it is time to go and check the Burst Balance in the Monitoring tab.

    Crishantha Nanayakkara

    Vice President - Technology

    LET'S GET IN TOUCH

    CONTACT US


    PHONE
    +1 919-943-6974 (USA)
    +94 117 112 191 (SL)
    ADDRESS
    130E, San Fernando Street,
    #514 San Jose, CA 95112, USA

    LOCATIONS

    OUR GLOBAL PRESENCE