How can I use CloudWatch metrics to calculate the average throughput and average number of IOPS my EBS volume is providing?

Last updated: 2022-09-28

I want to calculate the average throughput and number of IOPS for my Amazon Elastic Block Store (Amazon EBS) volume. How do I use Amazon CloudWatch metrics to do this?

Short description

You can use CloudWatch to monitor the status of your EBS volumes. Then, use this data to determine the average number of IOPS provided and the average throughput of your volume.

Calculate the volume's active time with the following formula:

( Period(VolumeIdleTime) - (VolumeIdleTime) )

Calculate the actual average IOPS in Ops/s with the following formula:

((VolumeReadOps) + (VolumeWriteOps) ) / ( Period(VolumeIdleTime) - (VolumeIdleTime) )

Calculate the actual average throughput in bytes/s with the following formula:
((VolumeReadBytes )+ (VolumeWriteBytes) ) / ( Period(VolumeIdleTime) - (VolumeIdleTime) )

Note: The Sum statistic in CloudWatch for VolumeReadBytes and VolumeWriteBytes reports the total number of bytes transferred during the specified period.

Resolution

  1. Open the CloudWatch console.
  2. Under Metrics in the sidebar, select All metrics.
  3. Select EBS, and then select Per-Volume Metrics.
  4. Select the metrics that you want to graph:
    To graph the actual average IOPS, select VolumeReadOps, VolumeWriteOps, and VolumeIdleTime
    To graph the actual average throughput, select VolumeReadBytes, VolumeWriteBytes, and VolumeIdleTime.
  5. Select the Graphed metrics tab.
  6. In the Statistic dropdown list, select Sum.
  7. Select the period of time that you want to view from the Period dropdown list.
    Note: The Period in the previously mentioned formulas represents a given time in CloudWatch. The specified Period of the CloudWatch graph equals the volume's collection period.
  8. In the Add math dropdown list, select Start with empty expression. Then, enter the following expression: (m1 + m2)/(PERIOD(m3)-m3)
  9. Select Apply.