How to calculate current IOPS usage and IOPS credit count and graph on AWS RDS

Solution 1:

As mentioned in How can I see my IOPS burst credits? (source):

Unfortunately there isn't a Cloudwatch Metric for the current IOPS Credit balance like there is with the CPU credits.

This has still not been implemented as of July 2016.

The AWS docs offer a pretty good introduction to IOPS burst:

Each volume receives an initial I/O credit balance of 5.4 million I/O credits, which is enough to sustain the maximum burst performance of 3,000 IOPS for 30 minutes. This initial credit balance is designed to provide a fast initial boot cycle for boot volumes and to provide a good bootstrapping experience for other applications. Volumes earn I/O credits at the baseline performance rate of 3 IOPS per GiB of volume size. For example, a 100 GiB gp2 volume has a baseline performance of 300 IOPS.

When your volume requires more than the baseline performance I/O level, it draws on I/O credits in the credit balance to burst to the required performance level, up to a maximum of 3,000 IOPS. Volumes larger than 1,000 GiB have a baseline performance that is equal or greater than the maximum burst performance, and their I/O credit balance never depletes. When your volume uses fewer I/O credits than it earns in a second, unused I/O credits are added to the I/O credit balance. The maximum I/O credit balance for a volume is equal to the initial credit balance (5.4 million I/O credits).

So taking your example, your 20 GB volume has a baseline performance of 60 IOPS. If you use an average of 50 IOPS, 10 I/O credits will be added to your credit balance every second, up to a maximum of 5.4 million I/O credits.

Solution 2:

AWS just released the feature, this may help you to monitor your IOPS:

Burst Bucket Metric Now Available for Amazon EBS General Purpose SSD (gp2) Volumes

(at the moment it's only available for gp2 volumes, but we can guess other volumes are on the way)

Solution 3:

Although burst balance graph is not yet available in web console it can be retrieved in aws cli with command like this:

aws cloudwatch get-metric-statistics --namespace AWS/RDS --metric-name  BurstBalance --dimensions Name=DBInstanceIdentifier,Value=YOUR_INSTANCE_NAME --start-time $(date +%s -d "-6 hours") --end-time $(date +%s) --period 30 --statistics Average

This command will return something like this:

DATAPOINTS      99.999962963    2018-12-26T18:00:00Z    Percent
DATAPOINTS      100.0   2018-12-26T17:25:00Z    Percent
DATAPOINTS      99.999962963    2018-12-26T16:50:00Z    Percent
DATAPOINTS      100.0   2018-12-26T16:15:00Z    Percent

Solution 4:

Building on the answer of Vladimir: the BurstBalance metric is now also available in Cloudwatch, so you can set up and alarm based on it there.

Solution 5:

This is available for EC2 gp2 Volumes as well as RDS gp2 Volumes.

To view it for EC2 EBS Volumes, go to Cloudwatch -> Metrics -> EBS -> BurstBalance.

To view it for RDS Instances, go to Cloudwatch -> Metrics -> RDS -> BurstBalance.