Amazon first launched their T2 instance family in 2014. This particular type of instance offers “Burst” capacity, which is great for spiky workloads that may be relatively idle for large periods of the day, but need lots of performance when they have work to do.
Personally, I’m a huge fan of T2s. For a large portion of workloads that need to be on 24/7 but don’t have constant usage, T2s can fit in perfectly. They are also great for Dev & Test environments that you don’t want to be under-powered, while at the same time they have only periodic usage.
One T2 feature that is often overlooked is that T2 Burst performance is 40% higher than C4 and 60% higher than M4. <link>(Source) <link> https://youtu.be/FkMslBsVYFU?t=440 ) Don’t let the number of vCPUs fool you! A task running on T2, while bursting, will have more performance available to it than on a comparable M4 or C4 instance.
AWS subsequently launched even larger T2 instance types – the T2.Xlarge and T2.2Xlarge in 2016 which saw the potential use cases for the T2 family grow significantly.
When AWS launched T2.Unlimited at re:invent in 2017, it was the final key to unlocking the true value of what T2s offered. Before then, people had been cautious to run critical workloads on T2s, concerned that they may run out of CPU credits and see a large drop in performance. However with T2.Unlimited, you now have the option to buy more CPU credits on-demand when you run out, giving you piece of mind that your services won’t see a drop in performance.
How should you check if T2 is right for you? Try it out, analyze your AWS usage, or contact us!
To Try it out, launch an instance with your workload and setup a CloudWatch alert (Link to: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances-monitoring-cpu-credits.html) on your CPU Credits. Assuming you’re not RAM limited, if you notice your CPU Credit balance is staying high, try downsizing your instance type to a smaller version to save money.
How does T2.Unlimited play into this?
T2.Unlimited costs $.05 per vCPU per hour of additional burst capacity purchased. You only pay per CPU-credit needed when you run out, which can be bought in fractions of an hour. This allows your instance to keep clipping along in the event of a prolonged spike of usage.
How does this save you money?
Lets compare running on a T2.Large vs a T2.Medium with T2.Unlimited turned on.
T2.Medium can burst for 4 hours and 48 minutes
T2.Large can burst for 7 hours and 12 minutes
Lets assume you maximize your usage of the T2.Large and use the burst capacity for 6hrs and 45 minutes a day which is 94% of your total daily credits.
To keep up a T2.Medium may have to burst an extra 2 hours a day beyond the credits you already get (4hrs 45min vs 6hrs 45min you actually use). The following table illustrates the cost for each alternative.
Instance Name | vCPUs | RAM | Hourly Cost | Monthly Cost | Daily Burst Hours | Monthly Burst Cost | Total Monthly Cost |
---|---|---|---|---|---|---|---|
T2.Medium | 2 | 4.0 GiB | $0.0464 | $33.87 | 2 | $6.00 | $39.87 |
T2.Large | 2 | 8.0 GiB | $0.0928 | $67.74 | 0 | -- | $67.74 |
Assuming your workloads can operate with less RAM, you’ll save 40% with a T2.Medium over a T2.Large!