DoiT

Here, our engineering teams share the solutions to some of the most exciting challenges we…

Follow publication

RDS Storage: GP3, GP2 and Provisioned IOPS Cost Comparison

So you want to create an RDS database in AWS, but which storage option to choose?

Tom Rosenfeld
DoiT
Published in
5 min readMar 5, 2024

--

This article highlights some of the issues and best practices for choosing the most cost effective SSD Volumes in RDS.

There are three choices for SSD storage in RDS. Amazon RDS offers two types of General Purpose SSD storage: gp2 or gp3. In addition, there is Provisioned IOPS SSD io1. (There is also the old magnetic storage, which is too slow for most applications. Note that io2, available in EBS, is not yet supported in RDS).

  • gp2 — Older generation, IOPS depends on the size of the volume, burstable
  • gp3 — Current generation, consistent IOPS, comes with baseline IOPS but can purchase additional IOPS and throughput
  • io1 — (Sometimes known as PIOPS). Consistent performance, Provisioned IOPS must be purchased. Most expensive.

All three storage types provide single-digit millisecond latency.

The cost per GB is the same for gp2 or gp3 in RDS (unlike in EC2 where gp3 is cheaper). However, gp3 provides more baseline IOPS (for volumes up to 4,000 GB) without the limitation of bursting.

Pricing matrix spreadsheet

The following spreadsheet shows the details of pricing and IOPS for a given size volume in gp2 vs. gp3 vs. io1.

SSD Volume cost comparison

Here are some examples from above:

If you have a 1,000GB volume, you will get 12,000 sustained IOPS on gp3. On gp2 you will get the same 12,000 IOPS, but only for limited bursts. Your sustained IOPS is only 3,000. Both will cost the same $115. Using io1 PIOPS configured with the same 12,000 IOPS, you will $425!

If you need a 5,000GB volume, gp2 will give you 15,000 IOPS for $525. For the same price, gp3 will only give you 12,000 IOPS (although you could pay more to get more). io1 PIOPS would cost much more at $2,125.

RDS disk striping

All the RDS engines (except for MS SQL Server) stripe on 4 volumes after a certain minimum size. This means both gp2 and gp3 give a higher IOPS and throughput than you would normally expect as shown above.

Striping details:

  • MariaDB, MySQL, and PostgreSQL stripes for sizes above 400 GB
  • Oracle stripes above 200GB
  • Increasing an existing volume size that triggers a volume striping activity (e.g. > 400GB) can cause a significant increase in IOPS and latency for several hours during the modification.

See AWS for details on DB type and size [3].

So which storage type should you use?

In almost all cases, your default choice should be gp3. In the past, even for small IOPS needs, AWS recommended io1 for low consistent latency. However, now both io1 and gp3 offer single-digit millisecond latency. The only difference is that io1 provides it 99.9% of the time, while gp3 guarantees it “only” 99.0% of the time. Given that gp3 is up to 73% less expensive than io1 (assuming the io1 is configured with the same baseline as the gp3), this is an easy choice.

When you should use io1:

  • need more than 64,000 IOPS
  • need consistent performance better than 99.0% of the time

Modifying volume type on a running DB:

  • In general, there is no downtime for changes between io1, gp2 or gp3 [2]
  • However, you cannot make more than one change every 6 hours

FAQ

Should I use io1 + PIOPs?

  • Only if you need 64,000–256,000 IOPS (or over 4,000 Mbps throughput)
  • If you need I/O consistency of 99.9% vs. 99% for gp2 or gp3
  • It will cost you 270% more than gp2/gp3
  • Even though the AWS console shows io1 as the default (for some configuration templates), you can change it to gp3 (or other).

Should I ever create a new RDS DB with gp2?

  • Yes. If your required volume size is over 4,000 GB. In that case, the gp2 IOPS will be greater than the baseline gp3 would give (see the sheet above). If you need more IOPS than the gp2 baseline, it will be cheaper to use gp3 and buy the extra IOPS.

Should I convert from io1 to gp3 (or gp2)?

  • Yes! Assuming you need less than 64,000 IOPS you should convert to save up to 73% (see sheet).

Should I convert from gp2 to gp3?

It depends:

  • If it aint broke don’t fix it. No cost savings. Performance could get worse — see Gotchas below.
  • If the volume size is over 4,000 GB, gp3 will give fewer IOPS (unless you pay for more).
  • If your workload needs more IOPS than you are getting with gp2 then convert to gp3 and pay for any more needed IOPS.
  • Caveat: Like any DB modification, the best practice is to first clone your DB and then test the conversion. Make sure that gp3 is giving you the expected IOPS and throughput.

Gotchas

  • Growing past 400 GB initiates striping and consumes a significant amount of IOPS during the process, which could seriously affect latency. Therefore, it is best to start at 400 GB if you expect to grow soon. Oracle stripes at 200 GB, while MS SQL Server never stripes.
  • RDS storage autoscaling can be the source of many surprises. Be sure to understand all the limitations [1]. For example, it could unexpectedly initiate striping.
  • AWS might be giving you more IOPS than you pay for on your current gp2 volume. (This is especially true for workloads that are years old). Thus, if you change to gp3, you may lose the free IOPS and get worse performance. (You can check this in Cloudwatch and see if you are getting higher than expected IOPS.)
  • Per instance type IOPS limitations: All RDS instances are limited in bandwidth and IOPS. Even if you pay for PIOPS, your instance will throttle you if it is not big enough. The limitations per instance type can be found in the AWS EC2 doc [4].
    e.g.:
    c6g.4xlarge limited to 20,000 IOPS
    c7g.4xlarge
    limited to 20,000 IOPS but can burst 40,000

Bottom line

Be mindful when selecting the storage type for your RDS instances. You can usually save a bundle by selecting gp3 instead of io1 without sacrificing performance.

References:

[1] Managing capacity automatically with Amazon RDS storage autoscaling [2] Modifying an Amazon RDS DB instance
[3] Amazon RDS DB instance storage — Amazon RDS
[4] Amazon EBS–optimized instances — Amazon Elastic Compute Cloud

--

--

Published in DoiT

Here, our engineering teams share the solutions to some of the most exciting challenges we encounter at DoiT. If you like what we do, check our services page https://doit.com/services

Written by Tom Rosenfeld

Senior Cloud Architect at DoiT International specializing in infrastructure modernization

Responses (1)

Write a response