AWS EC2 Instance Comparison: T3 vs T3a vs T4g
AWS has a lot of different instance types and it can be difficult to decide which instance type would be the best for a particular use-case. In this article, we will compare three popular instance types: T3, T3a and T4g, across various dimensions such as their specs, their performance as well their cost.
Comparing T3, T3a and T4g instance families
T3 Instances
Amazon’s T instance family is optimized for “burstable” workloads. These workloads generally have low CPU utilization and occasional periods for high CPU activity (called bursts). The T3 instance family is a good fit for this type of workload and can be pretty cost-effective.
T3a Instances
T3 and T3a instances are pretty similar to each other, except the processor. The T3 instances ses the Skylake processor whereas the T3a instances use the AMD EPYC 7000 series processors.
T4g Instances
The T4g instances are powered by Arm-based AWS Graviton2 processors and are supposed to deliver better price and performance.
Performance
We compared the performance between these instance families by running a bunch of tests on the following instances:
- t3.xlarge
- t3a.xlarge
- t4g.xlarge
Instance Type | Number of cores | Memory (GB) |
---|---|---|
t3.xlarge | 4 | 16 |
t3a.xlarge | 4 | 16 |
t4g.xlarge | 4 | 16 |
Benchmark
We will be using Sysbench to run various tests to measure the CPU, Memory and File IO performance.
CPU
We ran the CPU benchmark using the following command: sysbench cpu --threads=4 run
.
We will be comparing the total time
as well as the total number of events
for the benchmark from start to end.
As we can see from the results below, t4g.xlarge
performed the best on this benchmark.
t3.xlarge
General statistics:
total time: 10.0008s
total number of events: 32591
t3a.xlarge
General statistics:
total time: 10.0010s
total number of events: 26621
t4g.xlarge
General statistics:
total time: 10.0004s
total number of events: 113588
Memory
We ran the CPU benchmark using the following command: sysbench memory --threads=4 run
.
We will be comparing the Operations performed
for the different instance types.
In this benchmark, t3.xlarge
performed the best whereas t4g.xlarge
performed the worst.
t3.xlarge
Total operations: 93129278 (9311302.73 per second)
90946.56 MiB transferred (9093.07 MiB/sec)
t3a.xlarge
Total operations: 85354682 (8533783.52 per second)
83354.18 MiB transferred (8333.77 MiB/sec)
t4g.xlarge
Total operations: 61109295 (6110003.56 per second)
59677.05 MiB transferred (5966.80 MiB/sec)
Disk performance
We also ran simple read & write benchmarks to test the performance of the EBS volumes on each of these instance types.
The T3a instances performed the best on the disk performance benchmarks.
t3.xlarge
Write
dd bs=16k count=102400 oflag=direct if=/dev/zero of=test_data
102400+0 records in
102400+0 records out
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 73.5538 s, 22.8 MB/s
Read
dd bs=16K count=102400 iflag=direct if=test_data of=/dev/null
102400+0 records in
102400+0 records out
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 44.5627 s, 37.6 MB/s
t3a.xlarge
Write
write
dd bs=16k count=102400 oflag=direct if=/dev/zero of=test_data
102400+0 records in
102400+0 records out
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 66.9927 s, 25.0 MB/s
Read
dd bs=16K count=102400 iflag=direct if=test_data of=/dev/null
102400+0 records in
102400+0 records out
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 39.1757 s, 42.8 MB/s
t4g.xlarge
Write
dd bs=16k count=102400 oflag=direct if=/dev/zero of=test_data
102400+0 records in
102400+0 records out
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 73.5538 s, 22.8 MB/s
Read
dd bs=16K count=102400 iflag=direct if=test_data of=/dev/null
102400+0 records in
102400+0 records out
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 65.7547 s, 25.5 MB/s
Pricing
We compared the prices between these instance families by looking at the price per hour for each instance type.
T4g instances are the cheapest amongst the three instance families whereas the T3 instances are the most expensive.
Price/core for Linux on-demand instances:
Instance Type | Price / hour |
---|---|
t3.xlarge | $0.1664 |
t3a.xlarge | $0.1504 |
t4g.xlarge | $0.1344 |
Conclusion
The new T4g instances provide better CPU performance and they are cheaper than T3 and T3a instances. This should be the go-to instance type in this instance family.