A Rundown of the New AWS EC2 T2 Unlimited Option
When we last discussed Amazon Web Services and the "t2" options, we cautioned that you might be expecting too much for the cheaper price and find yourself in a period of poor performance if you miscalculate, or simply experience an extended time of high usage. Until you can resolve the reasons for the high CPU usage, you can’t improve the performance of the existing instance - you have to reboot into a larger instance or offload the processing to another instance.
In an effort to alleviate these issues, Amazon has now added an option - Amazon AWS EC2 T2 Unlimited - that allows you to get beyond these times of stress. This new offering works by first borrowing future CPU credits, and then by charging a nominal per-hour fee. Announced at Amazon’s 2017 re:Invent, the new AWS EC2 T2 Unlimited Option allows you to sustain high CPU performance over a longer period of time while still keeping your costs down. And the best part is you can enable this on a running instance without the need to reboot.
So, How Does This Work?
Let's say we have a t2.small instance that earns 12 credits per hour (288 total per day) with a maximum credit allowance of 288 (credits expire after 24 hours). Since the baseline performance is 20% CPU, as long as we remain below that baseline usage we will earn credits up to the 288 maximum. If we exceed 20%, however, we’ll begin using our credits, with a credit equaling a vCPU operating at 100% for one minute (or 50% for two minutes, etc.). That means that if we’re running at 100% for an hour, we’ll use 60 credits while only earning 12. If we previously had the maximum amount of credits, we would exhaust all our credits in just six hours. For a standard t2 instance, we would then be throttled down to 20% maximum.
With the rollout of Amazon’s AWS T2 Unlimited, rather than throttling we can continue to operate at 100% CPU utilization. However, now we’ll start using "surplus" credits by “borrowing” up to the daily maximum of earned credits - so in this case 288 surplus credits. Assuming we are still operating at 100%, that will take another six hours. If our CPU usage drops back below our baseline before the tasks have completed running, our earned credits will start to pay off the surplus balance, and once that reaches zero we’ll start earning our normal credit balance again.
With the AWS T2 Unlimited option, once we exceed the daily maximum in surplus credits, we can still continue operating, but we then start getting charged for each CPU credit we consume. Surplus credits cost $0.05 per vCPU-hour (or $0.00833/credit) for Linux instances, and $0.096 per vCPU-hour for Windows instances. For a Linux instance operating at 100% for one hour with 48 incurred credits to be charged, at the end of the hour we would be billed $0.04 for the extra run time. At that rate, it would cost less than $1.00 to run at 100% for an entire day - likely a bargain compared to dealing with the poor performance you would otherwise suffer.
Here is a detailed look at the new cost per credit structure:
With that said, it is still very important to monitor your t2 instances closely to make sure they are performing within expectations and below the baseline for your instance type. In AWS CloudWatch, I typically set three alarms on my t2 instances, one to notify if CPU Credit Balance drops below 100, one to notify if CPU Utilization exceeds 95% for 1 hour (if there is a "fast burn" of CPU credits), and one to notify if CPU Utilization exceeds the baseline for 6 hours (look for a "slow burn" of CPU credits). You can adjust these as needed for your own expectations.
One thing to note if you are planning to create a new instance with the T2 Unlimited option enabled - unlike a standard instance, which when first created comes with a CPU credit balance to start, a new T2 Unlimited instance does not. Instead, you would use surplus credits for CPU usage exceeding the baseline if needed (initial setup and configuration of the instance, etc.).
For more information on implementing Amazon’s AWS EC2 T2 Unlimited in your business, schedule your free IT assessment today.