Sub topic 5
EBS-optimized instances and instance-level limits
This chapter assumes you know how volume types differ (gp3, io2, st1) and how IOPS, throughput and latency are measured. It covers a limit that sits above any single volume: the capacity of the instance itself.
What EBS-optimized means
EBS volumes are network-attached, so every read and write travels over a network path. An EBS-optimized instance has dedicated bandwidth for that path. EBS traffic does not compete with your application's other network traffic.
Current-generation instance types, including all Nitro-based types, are EBS-optimized by default at no extra charge. You only need to act on some older types, where it is an optional setting that can cost extra.
Instance limits cap volume limits
Each instance type has its own maximum bandwidth, throughput and IOPS toward EBS. The performance you get is the lower of two numbers:
- The combined limits of the attached volumes.
- The limits of the instance type.
A single io2 volume provisioned for 64,000 IOPS gains nothing on an instance type that tops out at 18,750 IOPS. The extra provisioned IOPS are paid for and unused.
Baseline and burst
Many instance types list two sets of numbers. The baseline is what the instance sustains continuously. The maximum is what it can reach in short bursts, typically for up to 30 minutes in a 24-hour period. After the burst credit is used, performance falls back to the baseline.
Checking an instance type's limits
Query the type before you size volumes for it:
aws ec2 describe-instance-types \
--instance-types m5.large m5.4xlarge \
--query 'InstanceTypes[].[InstanceType,EbsInfo.EbsOptimizedSupport,EbsInfo.EbsOptimizedInfo.BaselineIops,EbsInfo.EbsOptimizedInfo.MaximumIops,EbsInfo.EbsOptimizedInfo.BaselineThroughputInMBps,EbsInfo.EbsOptimizedInfo.MaximumThroughputInMBps]' \
--output tableEbsOptimizedSupport returns default, supported or unsupported. Types that report default need no action.
To turn the setting on for a type that reports supported, stop the instance first:
aws ec2 stop-instances --instance-ids i-0123456789abcdef0
aws ec2 modify-instance-attribute \
--instance-id i-0123456789abcdef0 \
--ebs-optimized
aws ec2 start-instances --instance-ids i-0123456789abcdef0Common errors
- Sizing volumes without checking the instance. A fast volume on a small instance type is throttled by the instance. Compare the sum of your volume IOPS and throughput with the instance's limits.
- Treating burst as sustained. A benchmark that finishes within the burst window looks fine, but a long-running job drops to baseline. Test for longer than 30 minutes.
- Assuming that more volumes means more speed. Several volumes on one instance share the same instance-level limit.
- Missing an instance bottleneck. Volume metrics can look healthy while the instance is the constraint. Compare the instance's
EBSReadBytesandEBSWriteByteswith the type's limits. On burst-capable types, theEBSIOBalance%andEBSByteBalance%metrics show how much burst credit remains.
Exercise
An instance type has a maximum of 18,750 IOPS to EBS. You attach two gp3 volumes, each provisioned for 16,000 IOPS, and run a workload that drives both at full speed. About how many IOPS can the instance achieve, and why?
Show answer
About 18,750 IOPS at most. The two volumes could deliver 32,000 IOPS together, but the instance-level EBS limit caps the total. On a burst-capable type this peak applies only for short periods, and the sustained rate is the lower baseline.