Interview Prep/AWS/S3, EBS and EFS

A database on gp2 is fast in the morning, then latency jumps and `VolumeQueueLength` climbs.

AdvancedTroubleshootingS3, EBS and EFS
Answer

Likely causes → gp2 gets baseline IOPS at 3 per GiB (minimum 100) and bursts to 3,000 IOPS from a credit bucket. Once BurstBalance reaches 0, the volume falls back to baseline. Another possibility is the instance's EBS bandwidth limit (EBSIOBalance% / EBSByteBalance% on smaller instances).

Diagnose →

for m in BurstBalance VolumeQueueLength VolumeReadOps VolumeWriteOps; do
aws cloudwatch get-metric-statistics --namespace AWS/EBS --metric-name $m \
  --dimensions Name=VolumeId,Value=vol-0abc --statistics Average --period 300 \
  --start-time $(date -u -d '-6 hour' +%FT%TZ) --end-time $(date -u +%FT%TZ) --output text | tail -3; done

Fix →

  1. Migrate online to gp3, which gives 3,000 IOPS and 125 MiB/s baseline independent of size: aws ec2 modify-volume --volume-id vol-0abc --volume-type gp3 --iops 6000 --throughput 250
  2. If the instance is the bottleneck, move to an instance type with more EBS bandwidth

Prevent → Use gp3 as the default volume type and alarm on queue length and latency (VolumeAverageReadLatency).

aws All AWS questions Roadmap: AWS core services

More on S3, EBS and EFS