Lesson 2 of 3 Amazon EBS

Troubleshooting EBS Performance with CloudWatch Metrics

This lesson explains how CloudWatch metrics show whether the volume, the instance or the application is the bottleneck when an application on EC2 is slow.

Learning outcomes

After completing this lesson, you will be able to:

  • Interpret EBS volume metrics such as BurstBalance and queue length.
  • Identify instance EBS bandwidth limits.
  • Follow a troubleshooting sequence.

Volume metrics

EBS publishes metrics in the AWS/EBS namespace at 1-minute granularity for Nitro-based instances. VolumeReadOps and VolumeWriteOps (divide by the period in seconds for IOPS) and VolumeReadBytes and VolumeWriteBytes show the work done. VolumeTotalReadTime and VolumeTotalWriteTime divided by operations give average latency. VolumeQueueLength shows requests waiting; a persistently high queue with IOPS at the provisioned limit means the volume is saturated. VolumeIdleTime shows when the volume does nothing. BurstBalance (gp2, st1, sc1) shows remaining burst credits, and VolumeIOPSExceededCheck and VolumeThroughputExceededCheck report 1 when the application asks for more than the volume's provisioned performance. VolumeStalledIOCheck detects volumes whose I/O has stalled.

Match the pairs

EBS metrics

Exam skills 1.3.2

Match each question about a volume with the metric that answers it.

Log in to try this activity Interactive activities are free with an account.

Instance limits

Every instance type has a maximum EBS bandwidth, throughput and IOPS shared by all its volumes. Smaller types also have a baseline with burst for up to 30 minutes a day. The instance metrics EBSIOBalance% and EBSByteBalance% show the remaining burst for these, and the instance metrics InstanceEBSIOPSExceededCheck and InstanceEBSThroughputExceededCheck show when the instance is the limit. Adding provisioned IOPS to a volume does nothing if the instance cannot deliver them; the fix is a larger or EBS-optimised instance type.

The following diagram shows three fast volumes behind a slower instance.

When the instance, not the volume, is the limit. Three volumes provisioned with 16,000 IOPS each could deliver 48,000 IOPS, but the instance type supports far fewer, so the application never sees more than the instance maximum. InstanceEBSIOPSExceededCheck shows this, and the fix is a larger or EBS-optimised instance type.
The volume figures are illustrative; each instance type's EBS maximum is in the EC2 documentation.
Scenario questions

Volume or instance limit?

Exam skills 1.3.2 · 1.3.6

Decide whether the volume or the instance limits performance.

Log in to try this activity Interactive activities are free with an account.

A troubleshooting sequence

The following sequence separates the possible causes of slow EBS performance.

  1. Volume limits

    Check VolumeIOPSExceededCheck and VolumeThroughputExceededCheck. If they report 1, provision more IOPS or throughput, or change the volume type.

  2. Burst credits

    For gp2, st1 or sc1, check BurstBalance. If it falls to zero, move to gp3 with provisioned performance or a larger volume.

  3. Instance limits

    Check the instance's EBS balance metrics and exceeded checks. If the instance is the limit, choose a type with more EBS bandwidth.

  4. Queue and latency

    Check VolumeQueueLength and latency. A high queue with low IOPS can point to an application issue or a volume being initialised from a snapshot.

  5. Restored volumes

    For newly restored volumes, consider initialisation or fast snapshot restore.

Worked example

Nightly batch job slows down

A nightly batch job on an m5.large reads a 500 GiB gp2 volume and has started taking twice as long. BurstBalance drops to zero 20 minutes into the job, after which VolumeReadOps flatten at 1,500 IOPS, the gp2 baseline for 500 GiB. Changing the volume to gp3 with 6,000 IOPS and 250 MiB/s removes the burst dependency. After the change the job still plateaus, now at the m5.large EBS throughput limit, shown by InstanceEBSThroughputExceededCheck; moving the job to an m7i.xlarge resolves it.

Check yourself

BurstBalance on an st1 volume has fallen to zero. What happens?

Show answer

Its burst credits are exhausted, so throughput drops to the volume's baseline until credits are earned again.

Exam Tips

Remember for the exam

  • VolumeIOPSExceededCheck/ThroughputExceededCheck = 1: the volume's provisioned performance is the limit.
  • BurstBalance at zero: gp2/st1/sc1 credits exhausted.
  • Instance EBS bandwidth can cap performance regardless of the volume.
  • High VolumeQueueLength with IOPS at the limit indicates a saturated volume.