This first change recently announced is that CPU credits earned by a T2 instance no longer expire. They used to expire within 24 hours of them being earned, assuming they were unused.
The second announcement is around T2 Unlimited.
You can now designate a T2 instance as a T2 Unlimited instance. T2 Unlimited instances are always able to run above their baseline. This is done via two methods, borrowing credits and being able to pay $0.5 per vCPU hour used above the baseline, or an easier way to think about it is $0.0008 for each additional CPU credit needed.
Let’s talk about borrowing credits.
As mentioned above each T2 instance types has a maximum number of vCPU credits it can earn. A T2 unlimited instance can utilize all those credits right from the moment it launches. So, for example, a t2.small instance can utilize up to 288 CPU credits right at its launch. The catch is that those credits are borrowed and need to be paid back over the next 24 hours. If you still have a balance of credits that haven’t been paid back, then you pay $0.0008 per outstanding credit. Because T2 Unlimited instances can borrow credits they do not start with a balance of 30 CPU credits.
This is better understood with an example. We have our t2.small that immediately consumes 100% CPU for 90 minutes after it is launched. The t2.small’s baseline is 20% so this would consume 80% of 90 CPU credits, or 72 CPU credits are needed. The t2.small earns 12 CPU credits per hour, so it can use the 18 CPU credits it earns over the 90 minutes and borrow the remaining 54 CPU credits it needs.
Any credits earned by the t2.small instance is used to pay off that 54 credit balance. If the utilization stays below its baseline for the next 4.5 hours, then the borrowed balance is paid off. But, if the instance doesn’t earn enough credits to pay off the balance, say it continues to use the CPU credits it earns, then $0.0008 is paid per credit at the end of the 24-hour period, or in this case $0.043 for the 54 credits.
Now an instance can only borrow up to its maximum number of credits it can earn, so if this t2.small ran at 80% non-stop it would borrow 48 credits per hour, maxing out all it’s credits in 6 hours. Once the max is borrowed then any additional CPU credits needed will be billed at $0.0008 per credit (i.e. AWS calls this $0.05 per vCPU hour). This contrasts with a standard T2 instance which would have its performance cut back to it’s baseline once it’s CPU credits are used.
So, is this all worth it?
If you are running a small workload, say something that only needs 1 vCPU or 4GBs of Mem or less, then you’ll want to consider T2s. I’d recommend always using a T2 unlimited, as it’s provides the most flexibility, but you’ll want to watch the CPUSurplusCreditsCharged counter in CloudWatch. $0.0008 per vCPU credit isn’t a lot, but it can add up if you are running workload that should be running on a larger instance.
Now that the M5s are out the T2s don’t seem worth it for instances larger than a t2.medium. If I compare a t2.large with an m5.large, both have 2vCPU and 8GBs and they cost $0.0928 vs $0.0960 respectively. That is just a difference of $0.0032, one-third of a penny per hour, and with an m5 you get 100% of CPU performance all the time. It wouldn’t take much to push the costs of the t2.large over the cost of an m5.large.
So, run t2.medium and smaller as T2 Unlimited instances and use M5s for anything larger. And, keep an eye out for a T2 price drop which may make larger T2 instances compelling again.
BlueChipTek offers an array of cloud consulting options to help you have an Optimized Cloud experience. For more information, read more on our OptimizedCloud Services.