T Series EC2 Instances
The EC2 T series instances are probably the most used instance types when getting started with AWS. They're cost-effective and versatile EC2 instances so they're an all-around great choice for general computing.
They're especially great for variable workloads—like a web app that gets busy during peak hours and quiet during off-hours.
The current options are:
- t2: Older and less efficient, but still available (and free tier eligible as t2.micro)
- t3: Intel-based, more efficient than t2 (sometimes available in the free tier)
- t3a: AMD-based, often cheaper than t3
- t4g: ARM-based, typically the most cost-effective if your workload is compatible
Here's a closer look at these different instance types:
Hardware Differences: Nitro and Graviton
The t3, t3a, and t4g instances are all built on the newer AWS Nitro System. Nitro is AWS's modern virtualization software and hardware that gives us:
- Improved Performance: Less virtualization overhead means more of the hardware's power is available to your instances.
- Better Network Performance: You get higher bandwidth and lower latency, which is great for network-intensive applications.
- Enhanced Security: Nitro provides hardware-level isolation between instances, reducing the attack surface.
tl;dr nitro is newer and better so t3, t3a, and t4g are newer and better.
As for processors, t4g instances use AWS Graviton4 ARM-based chips designed by AWS. We can get up to 40% better price-performance compared to similar x86-based instances. If you can run your application on ARM, switching to t4g is a good call.
I personally use t4g the most and try to build and run everything on ARM.
The main reason to use the older t2.micro is that it's part of the free tier. So it's what we'll use in the examples in this course. But if it wasn't for the free tier, we'd be using t3 for x86 and t4g for arm.
Understanding CPU Credits and Burstable Performance
One thing you might have noticed about the table above is the CPU credits section. Which begs the question: "What the heck is a CPU credit?"
The T series instances are part of AWS's "Burstable Performance" family. They use a CPU credit system that lets instances burst above their baseline CPU performance when needed. This keeps costs low as long as you're not maxing out the CPU all the time.
You can "burst" up to 100% CPU utilization for a bit, but you need to let the instance chill-out at lower CPU usage to earn credits for future bursts.
It might sound a bit weird because it's not how normal computers work, but let's break it down.
How CPU Credits Work
Each T series instance has a baseline performance, which is a percentage of the CPU you can use continuously without dipping into your CPU credits. For micro instances, that's 10% CPU utilization. When you operate below this baseline, you earn CPU credits. When you operate above the baseline, you use CPU credits.
For reference, here's a quick example of me installing bun and setting up a Next.js dev server. The CPU usage spikes whenever I do something processor intensive, but settles back down and doesn't spike for basic HTTP requests.