Sub topic 10
Benchmarking price-performance before you switch
Moving a workload from x86 to Graviton only pays off if it does the same work for less money. This chapter shows how to measure that before you change production. It assumes you can use the AWS CLI and CloudWatch, run a Linux load generator, and have already checked Arm64 compatibility for your software.
Why compare price-performance, not price
Graviton instances usually list at a lower hourly price than the x86 instance of the same size. A lower price does not help if the instance needs more of them to carry the same load. The number to compare is cost per unit of work, for example dollars per million requests.
Design a fair test
A benchmark gives useful results only if the two sides differ in one thing: the CPU architecture. Keep everything else the same.
- Use the same application version, built natively for each architecture.
- Use the same instance size class, such as 4 vCPU and 8 GiB, and the same storage and network settings.
- Run in the same Region and Availability Zone.
- Use the same load generator, the same test data and the same duration.
- Warm up first. Run 5 to 10 minutes of traffic that you discard, so caches and JIT compilers settle.
- Repeat each run at least three times and compare medians, since single runs vary.
Replay a recorded sample of real production traffic if you can. Synthetic tests often miss the request mix that drives your CPU use.
Find the throughput limit
Increase the request rate in steps. At each step, record the throughput, the p50 and p99 latency, and the error rate. Stop when p99 latency or errors cross your service limit. The highest rate that stays inside the limit is the capacity of one instance.
Collect the data
Launch the Graviton test instance from an Arm64 image. This command looks up the latest Amazon Linux 2023 Arm64 AMI.
aws ssm get-parameter \
--name /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64 \
--query 'Parameter.Value' \
--output textOn each host, confirm the architecture you are testing. This guards against a mixed-up fleet.
uname -m
# x86_64 on Intel/AMD instances, aarch64 on Graviton instancesWhile the test runs, pull CPU data for the test window. Use the same time range for both instances.
aws cloudwatch get-metric-statistics \
--namespace AWS/EC2 \
--metric-name CPUUtilization \
--dimensions Name=InstanceId,Value=i-0123456789abcdef0 \
--start-time 2026-11-01T00:00:00Z \
--end-time 2026-11-15T00:00:00Z \
--period 3600 \
--statistics Average MaximumFor a short benchmark, use a smaller range and a shorter period, such as 60 seconds. Record your load generator's own numbers as well. CloudWatch shows resource use, and the load generator shows what users would see.
Compute cost per unit of work
Divide the hourly price by the hourly throughput at the capacity you found.
def cost_per_million(hourly_price, requests_per_second):
requests_per_hour = requests_per_second * 3600
return hourly_price / requests_per_hour * 1_000_000
x86 = cost_per_million(0.0850, 900)
arm = cost_per_million(0.0680, 1000)
print(f"x86: ${x86:.4f} per million requests")
print(f"Graviton: ${arm:.4f} per million requests")
print(f"Saving: {(1 - arm / x86) * 100:.1f}%")The prices and rates above are example values. Use the current On-Demand prices for your Region and your measured throughput. With these numbers, Graviton costs about $0.0189 per million requests against $0.0262, a saving of about 28%.
Read the results
| Result | What it suggests |
|---|---|
| Same or higher throughput, lower price | Strong case to switch |
| Lower throughput, but cost per request still lower | Switch, and plan for more instances |
| Lower throughput and higher cost per request | Stay on x86 or try a different size |
| Higher p99 latency at equal load | Investigate before switching, for example a library without Arm64 optimizations |
Keep the results. They become the baseline for the staged rollout, where you compare live metrics against these numbers.
Exercise
An x86 instance costs $0.10 per hour and sustains 800 requests per second within your latency limit. A Graviton instance costs $0.08 per hour and sustains 640 requests per second within the same limit. Which has the lower cost per million requests, and why does the hourly price alone mislead?
Show answer
Both cost the same per million requests. x86: 0.10 / (800 × 3600) × 1,000,000 ≈ $0.0347. Graviton: 0.08 / (640 × 3600) × 1,000,000 ≈ $0.0347. The Graviton instance is 20% cheaper per hour but also handles 20% less traffic, so the lower hourly price gives no saving per unit of work.