What are Amazon burstable instances?
Amazon burstable instances are an AWS instance family with a difference. Like other families of AWS instances, they guarantee a level of CPU performance, but they also have the ability to burst through the “baseline” level of performance to sustain a high CPU performance level for as long as a workload needs it. When used optimally, Amazon burstable instances are the closest there is to the claim that “in the cloud, you only pay for what you use.”
In 2010, Amazon introduced its t1.micro instance—an instance designed to operate at a low background level that allowed for brief “periodic” spikes when required—provided there were sufficient unused resources on the host. The success of Amazon's first burstable instance led to a range of t2 burstable instances in 2014, with users given the option of unlimited t2 burstable instances in 2017.
The range was improved in 2018 and 2019 with the arrival of next-gen t3 and t3a burstable instances, and further improved in September 2020 with the launch of t4g burstable instances powered by Arm-based Graviton 2 processors. According to Amazon, the Graviton 2 processor has seven times the performance, five times the memory, and four times the number of compute cores than its predecessor—resulting in up to 40% better price performance over t3 burstable instances.
But, how do Amazon burstable instances work? How are baseline levels of performance calculated? What is the difference between standard burstable instances and unlimited burstable instances? And, once you have an understanding of CPU credits, launch credits, and surplus credits, what is the best use of burstable instances? We shall attempt to answer all these questions and more in this article.
How do Amazon burstable instances work?
When you deploy a burstable instance, it has a predetermined maximum vCPU and memory capacity just like any other EC2 instance. For example, a t4g.large burstable instance has the same 2 vCPUs and 8 GiB of memory as an m6g.large general purpose instance. The difference between a burstable instance and a standard instance is that burstable instances have a “baseline” level of performance per vCPU, and when the instance is operating below the baseline level, it earns CPU credits.
CPU credits cover the cost of operating above the baseline level up to the maximum capacity of the instance until the credits are exhausted. Each CPU credit allows the instance to operate at 100% vCPU capacity for a minute, and the consumption of CPU credits is calculated on a pro rata basis—so you'd use half a CPU credit if the instance operated at 50% higher than the baseline for a minute, or if the instance operated at 100% of its capacity for thirty seconds.
The following chart shows an example of the concept in practice over a twelve hour period. The example shows a burstable instance with a 30% utilization baseline earning CPU credits while utilization of the instance is below 30%. As utilization of the instance increases beyond 30%, the credits are consumed until they're exhausted—when the maximum allowable utilization of the instance returns to 30%.
How baseline levels are calculated and CPU credits earned
Different-sized burstable instances have different baseline percentages per vCPU and earn CPU credits at different rates. It's also the case that each size of burstable instance has a limit on how many CPU credits can be accrued. One important note at this point is that if you switch off a t2 burstable instance, the CPU credit balance is reset to zero, while CPU credit balances for switched off t3 and t4 burstable instances are reset to zero after a week.
The table below shows the current range of t4g burstable instances, their baseline performance levels and the maximum number of CPU credits that are accrued per hour. Accruals of CPU credits are dependent on how far below the baseline performance level instances are operating. For example, a t4g.large burstable instance will earn 36 CPU credits an hour when instance utilization is 0%, but only 18 CPU credits per hour when the instance is operating at 15% (half its baseline percentage).
|Instance size||vCPU||Memory (GiB)||Baseline||CPU Credits/Hr|
|t4g.nano||2||0.5||5%||6 (max 144)|
|t4g.micro||2||1||10%||12 (max 288)|
|t4g.small||2||2||20%||24 (max 576)|
|t4g.medium||2||4||20%||24 (max 576)|
|t4g.large||2||8||30%||36 (max 864)|
|t4g.xlarge||4||16||40%||96 (max 2,304)|
|t4g.2xlarge||8||32||40%||192 (max 4,608)|
You can see the specifications, baseline percentages, and CPU credits per hour for t2 and t3 instances in the AWS User Guide.
Standard burstable instances vs. unlimited burstable instances
One frequently asked question about Amazon burstable instances is what happens when a spike in demand occurs and there are insufficient CPU credits to cover the increased demand. The answer to this question depends on whether you've deployed standard or unlimited burstable instances (you have the option to select one or the other at the point of deployment and can switch options after).
With standard burstable instances, basically nothing happens. The instance will continue to operate at its baseline percentage until demand falls and the instance is able to start earning CPU credits again. However, it's not like 2010 when burstable performance was dependent on there being sufficient unused resources on the host. The instance will be able to increase its performance as soon as it's accrued more CPU credits.
With unlimited burstable instances, the instance responds to the increase in demand by “borrowing” up to an entire day's worth of future CPU credits in advance in order to allow the burstable instance to continue bursting. Once the day's CPU credits are exhausted, the instance continues to deliver burstable performance using what are known as “surplus credits”—capacity that hasn't been earned and isn't included in the hourly rate.
Surplus credits are charged at the rate of $0.04 per vCPU hour for Linux, RHEL, and SLES operating systems. For older generation t2 and t3 instances operating on Linux, RHEL, and SLES, the charge increases to $0.05 per vCPU hour regardless of instance size, while for older-generation t2 and t3 instances operating on Windows and Windows SQL web, the charge is $0.096 per vCPU hour. Unfortunately, the latest t4 generation of burstable instances isn't available for Windows users yet.
Launch credits and best uses for Amazon burstable instances
If you've read older explanations of how Amazon burstable instances work, you may have come across the term “launch credits”. Launch credits only apply to older-generation t2 burstable instances because they compensate for the loss of CPU credit balances when t2 instances are switched off. Therefore, each time you switch on a t2 instance, you are credited with 30 launch credits per vCPU up to a maximum of 100 launches per account, per Region, per rolling 24-hour period.
Therefore, despite t2 instances not being as cost effective as t4g instances, there can be benefits to using the older generation instances for short-term activities—for example, developing, staging, and testing—when you'd normally have to wait for a t4g instance to accrue CPU credits before being able to burst the instance or pay for surplus credits. Generally, t2 burstable instances are 40% more expensive than t4g instances, but there are use cases where it may be profitable to pay the extra cost.
Later generation burstable instances are suitable for applications that can benefit from quick access to high levels of CPU when needed, but most of the time are using moderate levels of CPU. Application examples include a broad spectrum of general purpose workloads, including large scale microservices, caching servers, search engine indexing, e-commerce platforms, small and medium databases, virtual desktops, and business-critical applications.
Amazon burstable instances FAQs
Why are burstable instances the closest there is to “you only pay for what you use”?
When you provision an instance from other EC2 families, it's rare you'll use its full capacity. Therefore, you're paying for more capacity than you're using. With unlimited burstable instances (provided you utilize the baseline level of performance or higher), you're only paying for what you use. However, the cost of surplus credit could be more than the cost of excess capacity, so choose this option only after careful consideration.
How are t4g burstable instances more cost-efficient than older generation instances?
Because t4g instances use more efficient processors, they don't use as many resources, and therefore Amazon doesn't charge as much for them. Currently in the U.S. East (Ohio) Region, t4g.large instances cost $0.0672 per hour (September 2020). t2 instances with the same specifications cost $0.928 per hour, while t3 and t3a burstable instances cost $0.0832 and $0.0752 per hour respectively.
Can burstable instances be included in Reserved Instance (RI) purchases and AWS Savings Plans?
They can, but as mentioned above, you have to carefully consider how unlimited burstable instances are used in either committed discount plan. Depending on how your commitment is structured, you may end up paying more than the RI or Savings Plan is saving you by having unlimited burstable instances always running on surplus credit.
Is it possible to use a mixture of t2, t3, and t4 instances at the same time?
Yes. There are cases where you might want to use a mixture of different generation burstable instances. For example, if you were taking advantage of launch credits for non-production activities, operating some instances on a Windows operating system (which isn't supported by t4g instances yet), or optimizing an e-commerce platform with the latest generation of Amazon burstable instances.
What is the best way to control costs for unlimited burstable instances?
The best way to control costs for unlimited burstable instances is to create a budget policy via the CloudHealth platform. The platform will monitor the utilization of unlimited burstable instances and alert you when the instance is using an excessive number of surplus credits or when the projected spend to date is forecast to exceed the monthly budget.
For more answers to your AWS questions, see our in-depth guide: How To Accelerate Your AWS Cloud Journey To Reach Cloud Maturity