Understanding AWS T3 Burstable Instances: CPU Credits, Throttling, and When to Upgrade
Your EC2 application runs perfectly for hours, then suddenly grinds to a halt under moderate load — no memory pressure, no disk I/O bottleneck, just a CPU that refuses to go above 20%. If you're on a T3 instance, you've just hit a CPU credit exhaustion event, and understanding why requires a clear mental model of how burstable performance actually works.
TL;DR
| Concept | What It Means |
|---|---|
| CPU Credit | One credit = 1 vCPU running at 100% for 1 minute |
| Baseline Performance | The guaranteed CPU % a T3 instance can sustain indefinitely |
| Credit Accrual | Credits accumulate when CPU usage is below baseline |
| Credit Spend | Credits are consumed when CPU usage exceeds baseline |
| Unlimited Mode | Allows bursting beyond credit balance; surplus usage is billed |
| Throttling | In Standard mode, CPU is hard-capped at baseline when credits are exhausted |
The Core Mental Model: A CPU Credit Bank Account
Analogy: Think of CPU credits like a prepaid data plan. Your phone (the instance) has a baseline data speed available 24/7. When you stream video (burst workload), you draw from your prepaid data balance. When you're idle, the balance slowly refills. Once the balance hits zero and you have no top-up plan (Standard mode), your speed is throttled back to the baseline rate — not cut off entirely, just capped.
Every T3 instance has two key parameters that govern this system:
- Baseline CPU Utilization: The percentage of vCPU the instance can use continuously without spending credits. This varies by instance size.
- Credit Accrual Rate: The number of CPU credits earned per hour when the instance is running at or below baseline.
Credit Accrual & Spend: The Exact Mechanics
The math is straightforward once you internalize the unit definition:
1 CPU Credit = 1 vCPU × 100% utilization × 1 minute
This means 1 credit also equals: 1 vCPU at 50% for 2 minutes, or 2 vCPUs at 100% for 30 seconds.
Credit Accrual Formula
Credits earned per hour = vCPUs × Baseline% × 60 minutes
For a t3.small (2 vCPUs, 20% baseline): 2 × 0.20 × 60 = 24 credits/hour
Credit Spend Formula
Credits consumed per minute = vCPUs × (Actual CPU% − Baseline CPU%)
This formula yields credits per minute because 1 credit = 1 vCPU at 100% for 1 minute. The delta above baseline is the fraction of a full vCPU-minute being consumed beyond what is "free".
Worked Example — t3.small at 80% CPU for 10 minutes:
- vCPUs: 2
- Actual CPU: 80%, Baseline: 20%, Delta: 60%
- Credits per minute:
2 × 0.60 = 1.2 credits/min - Total over 10 minutes:
1.2 × 10 = 12 credits consumed
T3 Instance Baseline & Credit Reference
| Instance | vCPUs | Baseline CPU % | Credits Earned/Hour | Max Credit Balance |
|---|---|---|---|---|
| t3.nano | 2 | 5% | 6 | 144 |
| t3.micro | 2 | 10% | 12 | 288 |
| t3.small | 2 | 20% | 24 | 576 |
| t3.medium | 2 | 20% | 24 | 576 |
| t3.large | 2 | 30% | 36 | 864 |
| t3.xlarge | 4 | 40% | 96 | 2304 |
| t3.2xlarge | 8 | 40% | 192 | 4608 |
Note: Always verify current values in the official AWS documentation, as these may be updated.
The Full Credit Lifecycle
- Idle / Low Load: CPU stays below baseline. Credits accumulate at the instance's accrual rate up to the maximum balance cap.
- Burst Phase: CPU exceeds baseline. The delta above baseline is funded by drawing from the credit balance.
- Credit Exhaustion (Standard Mode): Balance hits zero. The hypervisor hard-throttles the vCPU to the baseline percentage. This is the "sudden slowdown" symptom.
- Recovery: Once load drops below baseline, credits begin refilling. Performance recovers proportionally as the balance grows.
Standard Mode vs. Unlimited Mode
T3 instances launch in Unlimited mode by default. This is a critical distinction from T2 instances, which default to Standard mode.
- Standard Mode: Hard ceiling at baseline CPU when credits are exhausted. Zero additional cost, but your application suffers performance degradation.
- Unlimited Mode (T3 Default): The instance can continue bursting beyond its credit balance. AWS bills the surplus CPU usage at a per-vCPU-hour rate. This prevents throttling but can generate unexpected charges on sustained high-CPU workloads.
Key Risk: An application with a runaway process in Unlimited mode will silently accumulate surplus CPU charges. Always set a CloudWatch billing alarm.
Monitoring CPU Credits in CloudWatch
AWS publishes dedicated CloudWatch metrics for T3 credit tracking. The three most operationally important metrics are:
| CloudWatch Metric | What to Watch For |
|---|---|
CPUCreditBalance | Trending toward zero = throttling risk (Standard) or surprise bill (Unlimited) |
CPUCreditUsage | Spikes indicate burst events; sustained high values signal a sizing problem |
CPUSurplusCreditBalance | Unlimited mode only: credits borrowed beyond the balance cap |
CPUSurplusCreditsCharged | Unlimited mode only: surplus credits that were not repaid and will be billed |
Recommended CloudWatch Alarm (AWS CLI)
🔽 Click to expand: Create a CPUCreditBalance low-balance alarm
aws cloudwatch put-metric-alarm \
--alarm-name "T3-CreditBalance-Low" \
--alarm-description "T3 CPU credit balance is critically low" \
--metric-name CPUCreditBalance \
--namespace AWS/EC2 \
--statistic Average \
--period 300 \
--evaluation-periods 3 \
--threshold 30 \
--comparison-operator LessThanThreshold \
--dimensions Name=InstanceId,Value=i-0123456789abcdef0 \
--alarm-actions arn:aws:sns:us-east-1:123456789012:ops-alerts \
--treat-missing-data notBreaching
Decision Framework: T3 vs. Fixed-Performance Instances
- Spiky, low-average workloads (dev/test, low-traffic web servers, CI agents) are the ideal T3 use case. The burst model is a cost advantage here.
- Sustained high-CPU workloads (video encoding, ML inference, high-traffic APIs) should use fixed-performance instances (M6i, C6i, etc.). Running T3 Unlimited under sustained load is almost always more expensive than the equivalent fixed-performance instance.
- Unpredictable workloads: Enable Unlimited mode, monitor
CPUSurplusCreditsChargedfor 2 weeks, then make a data-driven sizing decision.
Switching Between Standard and Unlimited Mode
🔽 Click to expand: AWS CLI commands to toggle credit mode
# Check current credit specification
aws ec2 describe-instance-credit-specifications \
--instance-ids i-0123456789abcdef0
# Switch to Standard mode (enables hard throttle, no surplus charges)
aws ec2 modify-instance-credit-specification \
--instance-credit-specifications \
'[{"InstanceId": "i-0123456789abcdef0", "CpuCredits": "standard"}]'
# Switch back to Unlimited mode
aws ec2 modify-instance-credit-specification \
--instance-credit-specifications \
'[{"InstanceId": "i-0123456789abcdef0", "CpuCredits": "unlimited"}]'
Glossary
| Term | Definition |
|---|---|
| CPU Credit | A unit representing 1 vCPU running at 100% utilization for 1 minute. |
| Baseline Performance | The sustained CPU percentage a T3 instance can use without consuming credits. |
| Credit Exhaustion | The state where the CPUCreditBalance reaches zero, triggering throttling (Standard) or surplus billing (Unlimited). |
| Surplus Credits | In Unlimited mode, credits borrowed beyond the maximum balance cap; billed if not repaid by subsequent idle periods. |
| Throttling | The hypervisor-enforced hard cap on vCPU usage at the baseline percentage when credits are exhausted in Standard mode. |
Next Steps
- 📖 AWS Docs: Burstable Performance Instances
- 📊 Enable detailed monitoring (1-minute granularity) on all T3 instances to catch credit drain events before they impact users.
- 💡 Use AWS Compute Optimizer to get data-driven recommendations on whether to right-size to a fixed-performance instance type.
- 🔔 Set billing alerts on
CPUSurplusCreditsChargedif running any T3 instances in Unlimited mode in production.
Comments
Post a Comment