AWS Builder Center
Amazon EC2 CPU Credits: Baselines, Bursting & Modes

Amazon EC2 CPU Credits: Baselines, Bursting & Modes

Learn how EC2 CPU credits work, including baselines, bursting, Standard vs Unlimited mode, CloudWatch metrics, and a practical t3.large example.

Introduction

Burstable EC2 instances (T2, T3, T3a, T4g) are designed for workloads that don’t require constant high CPU but occasionally need short periods of increased performance. Instead of providing a fixed CPU capacity at all times, AWS uses a CPU credit system to balance efficiency and flexibility.
With this model, an instance earns CPU credits over time and uses them based on CPU utilization. When usage stays below its baseline, the credit balance increases. When usage goes above baseline, credits are used faster than they are earned, allowing the instance to handle temporary spikes in demand.
Understanding how CPU credits work is essential for predicting performance behavior, avoiding unexpected throttling, and optimizing both cost and resource utilization.

1) What are CPU credits?

  • CPU credits are a mechanism used by burstable EC2 instances such as T2, T3, T3a, and T4g
  • They let the instance temporarily use more CPU than its baseline
  • 1 CPU credit = 1 vCPU running at 100% for 1 minute

Simple idea

  • Low CPU usage → save credits
  • High CPU usage → spend credits
So the instance behaves like it has a small CPU “bank account”.



2) How credits are earned

Each burstable instance type has a fixed earn rate, measured in credits per hour.
Examples:
  • t3.micro → 12 credits/hour
  • t3.small → 24 credits/hour
  • t3.large → 36 credits/hour
AWS gives these credits gradually over time while the instance is running.
You earn credits continuously at a fixed rate; when CPU usage is below baseline, your balance increases.



3) What baseline means

The baseline CPU performance is the CPU level the instance can sustain continuously without draining its accumulated credit balance.
At baseline, the instance earns CPU credits at the same rate that it uses them.

Formula

Baseline CPU % per vCPU = (CPU credits per hour / (60 × number of vCPUs)) × 100

Example: t3.large

  • Earn rate = 36 credits/hour
  • vCPUs = 2
36 / (2 × 60) = 0.30 = 30%
So a t3.large can sustain:
  • 30% CPU utilization continuously
  • Equivalent to an average of 0.6 vCPU of continuous compute across its 2 vCPUs
In Amazon CloudWatch, this corresponds to approximately 30% CPUUtilization.
At this level, the instance earns credits at the same rate that it uses them, so its credit balance remains stable.



4) How credits are spent

CPU usage consumes credits continuously.
When CPU usage goes above baseline, credits are consumed faster than they are earned, so the accumulated credit balance decreases.
Since:
  • 1 credit = 1 vCPU-minute at 100%
then:
  • 1 vCPU at 50% for 1 minute = 0.5 credit
  • 2 vCPUs at 100% for 1 minute = 2 credits
At baseline, the credit earn rate exactly covers the credit usage rate.
So in practice:
Net credit change = credits earned - credits used
When CPU usage is below baseline:
Credits earned > credits used
When CPU usage is at baseline:
Credits earned = credits used
When CPU usage is above baseline:
Credits earned < credits used



5) Credit balance

The metric CPUCreditBalance is the number of accumulated credits currently available.

Balance increases when:

  • CPU usage stays below baseline

Balance decreases when:

  • CPU usage goes above baseline

Max balance

There is a cap on how many credits can accumulate, typically equal to 24 hours of earnings.
Example:
  • t3.micro earns 12/hour
  • Max balance = 12 × 24 = 288 credits



6) Standard mode

In Standard mode:
  • You can burst while you have accumulated credits
  • As the credit balance runs low, CPU utilization is gradually reduced toward baseline
  • When the accumulated credit balance is depleted, sustained CPU performance is limited to baseline
  • The instance cannot use surplus credits to continue bursting

Standard mode behavior

  • Balance > 0 → bursting is allowed
  • Balance running low → CPU performance moves toward baseline
  • Balance = 0 → sustained CPU performance is limited to baseline



7) Unlimited mode

In Unlimited mode:
  • The instance can keep bursting even when the credit balance reaches zero
  • AWS allows it to use surplus credits
  • Credits earned later while CPU utilization is below baseline can pay down those surplus credits
  • If average CPU usage remains above baseline over a rolling 24-hour window, AWS may charge extra
So Unlimited mode is:
  • no immediate throttling when the credit balance reaches zero
  • but possible extra cost



8) How AWS gives credits to the instance

This is internal to AWS. The instance does not receive anything visible inside the OS.
What actually happens:
  • AWS maintains CPU credit accounting for the instance
  • AWS tracks credits earned by the instance
  • AWS tracks credits used based on CPU utilization
  • AWS tracks the accumulated CPUCreditBalance
  • In Unlimited mode, AWS also tracks surplus credit usage
  • In Standard mode, when accumulated credits are depleted, CPU performance is constrained toward baseline
So the “credits” are an internal AWS accounting mechanism.



9) Monitoring in CloudWatch

You can monitor burst behavior using CloudWatch.
Important metrics:
  • CPUCreditBalance → how many accumulated credits remain
  • CPUCreditUsage → how many credits were consumed
  • CPUSurplusCreditBalance → surplus credits used in Unlimited mode
  • CPUSurplusCreditsCharged → surplus credits that resulted in additional charges
  • CPUUtilization → actual CPU utilization
Low CPUCreditBalance means:
  • in Standard mode → throttling risk
  • in Unlimited mode → the instance may begin using surplus credits, which can lead to additional charges if sustained



10) Credit persistence

While the instance is running:
  • accumulated credits remain available up to the maximum balance
When the instance stops:
  • T2 → credits are lost
  • T3 / T3a / T4g → credits persist for 7 days



11) Real workload simulation: step by step

Let’s simulate a real example using a t3.large.

t3.large facts

  • 2 vCPUs
  • 36 credits/hour
Earn rate:
36 / 60 = 0.6 credits per minute
Baseline:
36 / (2 × 60) = 30% CPU utilization
This means the instance can sustain:
  • 0.6 credits/minute of CPU usage
  • equivalent to 0.6 vCPU of continuous compute
without decreasing its accumulated credit balance.

Important note about CPU percentages

For the simulation below, CPU usage is expressed as aggregate vCPU utilization.
Because a t3.large has 2 vCPUs:
  • 100% aggregate CPU = 1 fully utilized vCPU
  • 150% aggregate CPU = 1.5 fully utilized vCPUs
  • 200% aggregate CPU = both vCPUs fully utilized
This is different from Amazon CloudWatch CPUUtilization, which reports CPU utilization on a 0–100% scale for the whole instance.
For a t3.large:
  • 50% aggregate CPU = 25% CloudWatch CPUUtilization
  • 60% aggregate CPU = 30% CloudWatch CPUUtilization
  • 100% aggregate CPU = 50% CloudWatch CPUUtilization
  • 150% aggregate CPU = 75% CloudWatch CPUUtilization
  • 200% aggregate CPU = 100% CloudWatch CPUUtilization
The baseline of the t3.large is therefore:
60% aggregate CPU = 30% CloudWatch CPUUtilization



Scenario

Initial:
  • CPUCreditBalance = 20 credits
Workload:
  1. 30 min at 10% aggregate CPU
  1. 20 min at 100% aggregate CPU
  1. 40 min at 50% aggregate CPU
  1. 15 min at 150% aggregate CPU
  1. 60 min at 5% aggregate CPU



Phase 1: 30 min at 10%

The instance earns:
0.6 credits/minute
The workload uses:
0.10 credits/minute
Net change:
0.6 - 0.10 = +0.50 credits/minute
Over 30 minutes:
30 × 0.50 = +15 credits
Balance:
20 + 15 = 35 credits



Phase 2: 20 min at 100%

The instance earns:
0.6 credits/minute
The workload uses:
1.0 credit/minute
Net change:
0.6 - 1.0 = -0.4 credits/minute
Over 20 minutes:
20 × (-0.4) = -8 credits
Balance:
35 - 8 = 27 credits



Phase 3: 40 min at 50%

The instance earns:
0.6 credits/minute
The workload uses:
0.5 credits/minute
Net change:
0.6 - 0.5 = +0.1 credits/minute
Over 40 minutes:
40 × 0.1 = +4 credits
Balance:
27 + 4 = 31 credits



Phase 4: 15 min at 150%

The instance earns:
0.6 credits/minute
The workload uses:
1.5 credits/minute
Net change:
0.6 - 1.5 = -0.9 credits/minute
Over 15 minutes:
15 × (-0.9) = -13.5 credits
Balance:
31 - 13.5 = 17.5 credits



Phase 5: 60 min at 5%

The instance earns:
0.6 credits/minute
The workload uses:
0.05 credits/minute
Net change:
0.6 - 0.05 = +0.55 credits/minute
Over 60 minutes:
60 × 0.55 = +33 credits
Balance:
17.5 + 33 = 50.5 credits



12) Summary

Phase
Duration
Aggregate CPU
CloudWatch equivalent
Net credit change
Balance
Start
-
-
-
-
20
Light
30m
10%
5%
+15
35
Burst
20m
100%
50%
-8
27
Moderate
40m
50%
25%
+4
31
Heavy
15m
150%
75%
-13.5
17.5
Idle
60m
5%
2.5%
+33
50.5



13) When balance hits zero

Now suppose the instance runs at 200% aggregate CPU, meaning both vCPUs are fully utilized.
This is equivalent to:
100% CPUUtilization in CloudWatch
Credits used:
2.0 credits/minute
Credits earned:
0.6 credits/minute
Net change:
0.6 - 2.0 = -1.4 credits/minute
After Phase 5, the CPUCreditBalance is:
50.5 credits
Time to zero:
50.5 / 1.4 ≈ 36.1 minutes
Then, in Standard mode:
  • CPU performance is gradually reduced toward baseline as the credits are depleted
  • Sustained performance is limited to the baseline once the accumulated balance is exhausted
  • For a t3.large, that baseline is approximately 30% CPUUtilization in CloudWatch
In the aggregate-vCPU convention used in this simulation, that baseline is:
60% aggregate CPU



14) Final mental model

  • Earn credits steadily
  • Use credits as CPU is consumed
  • Below baseline → earn more credits than you use
  • At baseline → earn and use credits at the same rate
  • Above baseline → use more credits than you earn
  • Standard mode → performance moves toward baseline when accumulated credits run out
  • Unlimited mode → continue bursting with surplus credits, with possible extra cost



15) Compact formulas

Earn per minute

Earn/min = credits/hour / 60

Baseline CPU per vCPU

Baseline CPU % = (credits/hour / (60 × vCPUs)) × 100

Credits used per minute from CloudWatch CPUUtilization

Credits used/min = vCPUs × (CPUUtilization / 100)

Net credit change

Net credit change = credits earned - credits used

Credit balance

New Balance = Old Balance + Earned - Used



Conclusion

CPU credits provide a simple but powerful model for handling variable workloads on burstable EC2 instances:
  • You receive a steady stream of CPU credits over time
  • When your workload is light, you accumulate credits
  • When demand spikes above baseline, you use accumulated credits to burst
This system ensures that:
  • You get cost-efficient performance for workloads that are not constantly CPU-intensive
  • You still have flexibility to handle short bursts without upgrading instance types
However:
  • In Standard mode, running out of accumulated credits means sustained performance is limited to baseline
  • In Unlimited mode, you can continue bursting using surplus credits but may incur additional charges
In practice, managing CPU credits is about:
  • Understanding your workload patterns
  • Monitoring metrics in Amazon CloudWatch
  • Choosing the right mode (Standard vs Unlimited) based on performance vs cost trade-offs
At its core, CPU credits turn CPU usage into a predictable, measurable, and controllable resource, rather than a fixed limit.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article