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

## Short description

To calculate the average throughput and number of IOPS of your volume, use Amazon CloudWatch metrics and metric math. Also, create CloudWatch alarms to monitor the data in your Amazon EBS volumes.

## Resolution

- Open the CloudWatch console.
- Under
**Metrics**, choose **All metrics**.
- Choose
**EBS namespace**, and then choose **Per-Volume Metrics**.
- Select the corresponding metrics of the Amazon EBS volume:

To calculate average IOPS, select **VolumeReadOps**, **VolumeWriteOps**, and **VolumeIdleTime**.

To calculate average throughput, select **VolumeReadBytes**, **VolumeWriteBytes**, and **VolumeIdleTime**.
- Choose the
**Graphed metrics** tab.
- For
**Statistic**, choose **Sum**.
- For
**Period**, choose the period of time that you want to view.
- Note the metric IDs in front of each graphed metric, for example m1, m2, m3, and so on.
- For
**Add math**, choose **Start with empty expression**, and then enter the following expressions to calculate the expected average value.

Calculate the average IOPS in Ops per second when the volume is active:

**Note:** In the following expression, **m1** is **VolumeReadOps**, **m2** is **VolumWriteOps**, and **m3** is **VolumeIdleTime**. Also, **PERIOD()** is a metric math function that returns the period of the metric in seconds.

(m1+m2)/(PERIOD(m1)−m3)

Calculate the average IOPS in Ops per second:

**Note:** In the following expression, **m1** is **VolumeReadOps** and **m2** is **VolumeWriteOps**.

(m1+m2)/(PERIOD(m1))

Calculate the actual average throughput in bytes per second when the volume is active:

**Note:** In the following expression, **m1** is **VolumeReadBytes**, **m2** is **VolumeWriteBytes**, and **m3** is **VolumeIdleTime**.

(m1+m2)/(PERIOD(m1)−m3)

Calculate the average throughput in bytes per second:

**Note:** In the following expression, **m1** is **VolumeReadBytes** and **m2** is **VolumeWriteBytes**.

(m1+m2)/(PERIOD(m1))

**Note:** Because of micro bursting, the average value of throughput and IOPS might be different from the actual average value. Throughput and IOPS are per-second measurements. CloudWatch doesn't aggregate Amazon EBS volume metrics at the per-second interval. For more information, see How can I identify if my Amazon EBS volume is micro-bursting and then prevent this from happening?

## Related information

Amazon CloudWatch metrics for Amazon EBS