When working with AWS EBS General Purpose (SSD) volumes, the burst credit system is crucial for maintaining consistent performance. Each volume starts with an initial balance of 5,400,000 I/O credits, allowing temporary bursts up to 3,000 IOPS. The baseline performance depends on your volume size (3 IOPS per GiB).
The most direct way to check your current burst balance is through CloudWatch metrics. Here's how to retrieve the data programmatically:
aws cloudwatch get-metric-statistics \
--namespace AWS/EBS \
--metric-name BurstBalance \
--dimensions Name=VolumeId,Value=vol-1234567890abcdef0 \
--statistics Average \
--start-time $(date -u +"%Y-%m-%dT%H:%M:%SZ" --date "-5 minutes") \
--end-time $(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--period 60
For ongoing monitoring, consider this Python script using boto3:
import boto3
from datetime import datetime, timedelta
cloudwatch = boto3.client('cloudwatch')
def get_burst_balance(volume_id):
response = cloudwatch.get_metric_statistics(
Namespace='AWS/EBS',
MetricName='BurstBalance',
Dimensions=[{'Name': 'VolumeId', 'Value': volume_id}],
StartTime=datetime.utcnow() - timedelta(minutes=5),
EndTime=datetime.utcnow(),
Period=60,
Statistics=['Average']
)
return response['Datapoints'][0]['Average'] if response['Datapoints'] else None
For a comprehensive view, create a CloudWatch dashboard with these widgets:
- BurstBalance (percentage of remaining credits)
- VolumeReadOps and VolumeWriteOps (to correlate with credit usage)
- VolumeQueueLength (to identify performance bottlenecks)
To maintain optimal performance:
- Right-size your volumes (larger volumes earn credits faster)
- Implement application-level throttling when approaching low credit thresholds
- Consider gp3 volumes for consistent performance without burst credits
Amazon EBS General Purpose SSD (gp2) volumes use a burst bucket mechanism to provide temporary performance boosts. Each volume starts with 5.4 million I/O credits, allowing bursts up to 3,000 IOPS for 30 minutes. The volume continuously earns credits at its baseline rate (3 IOPS per GiB per second).
To track your burst credit balance, you need to monitor these CloudWatch metrics:
BurstBalance
- Percentage of burst credits remaining (0-100%)VolumeReadOps
- Read operations countVolumeWriteOps
- Write operations count
Here's how to retrieve burst credit metrics using AWS CLI:
aws cloudwatch get-metric-statistics \
--namespace AWS/EBS \
--metric-name BurstBalance \
--dimensions Name=VolumeId,Value=vol-1234567890abcdef0 \
--statistics Average \
--start-time $(date -u +"%Y-%m-%dT%H:%M:%SZ" --date "-1 hour") \
--end-time $(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--period 60 \
--output json
Create an alarm when burst credits drop below a threshold:
aws cloudwatch put-metric-alarm \
--alarm-name "Low-EBS-Burst-Credits" \
--alarm-description "Alarm when EBS burst credits drop below 20%" \
--metric-name BurstBalance \
--namespace AWS/EBS \
--statistic Average \
--dimensions Name=VolumeId,Value=vol-1234567890abcdef0 \
--period 300 \
--evaluation-periods 1 \
--threshold 20 \
--comparison-operator LessThanThreshold \
--alarm-actions arn:aws:sns:us-east-1:123456789012:MyTopic
Create a dashboard to monitor burst credits over time:
aws cloudwatch put-dashboard \
--dashboard-name "EBS-Performance" \
--dashboard-body '{
"widgets": [
{
"type": "metric",
"x": 0,
"y": 0,
"width": 12,
"height": 6,
"properties": {
"metrics": [
["AWS/EBS", "BurstBalance", "VolumeId", "vol-1234567890abcdef0"]
],
"period": 300,
"stat": "Average",
"region": "us-east-1",
"title": "EBS Burst Credit Balance"
}
}
]
}'
- Monitor
BurstBalance
regularly for critical volumes - Consider gp3 volumes for predictable performance without burst mechanics
- Size your volumes appropriately to maintain sufficient baseline performance
- Implement auto-scaling for storage when burst credits are consistently depleted