With the recent move from Apple to ARM-based CPUs, everyone seems to be in awe of the performance of the ARM-based Apple M1s.

As a cloud engineer, I couldn’t avoid asking if this performance translates to cloud computing too.

AWS has their line of ARM CPUs called Graviton, available in their second generation as the m6g family in EC2. Those CPUs are on average 20% cheaper for the same amount of vCPUs and RAM, but how do they compare in terms of real-world performance, against traditional Intel CPUs? That’s what we are here to find out.

Setup

 

Intel

ARM

Instance Count 1 1
Instance Type m5.large m6g.large
CPU Tested Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Custom built AWS Graviton2 Processor with 64-bit Arm Neoverse cores
CPU Count 2 2
Clock (MHz) 3397.426 N/A
Region/AZ ap-southeast-2c ap-southeast-2c
Price (Sydney) $0.120 per Hour $0.096 per Hour

cat /proc/cpuinfo didn’t show much information for the Graviton CPUs, I guess AWS wants to be secretive about it.

Application

Platform

The goal is to simulate a workload close to a real-world scenario, so we chose to use a Laravel API connecting to a MySQL database, which is a popular stack today.

The infrastructure used:

  • AWS ECS running in EC2
  • 2 Docker containers (ECS tasks) running the same App in one instance
  • Containers limited to 1GB RAM (soft and hard limit), but no limit on CPU usage

Container

  • Intel: FROM php:7.1-apache
  • ARM: FROM arm64v8/php:7.1-apache

Test Tool

ab -n 1000 -c 20 https://${HOST}/api/articles/test-post
^      ^      ^
⎮      |      ⎩ 20 concurrency
⎮      ⎩ 1000 requests
⎩ Apache Benchmark

Results

TL;DR

Graviton2 processors (m6g.large) are on average 25% faster than Intel on an m5.large instance.

Given that m6g.large is 20% cheaper, we get a total of 40% gain in price/performance.

Data (higher is better)

Graviton2 is almost 29% faster when shooting requests to a single container and the database behind is exactly the same.

When adding a second container to answer requests, interestingly Gravitons didn’t see any improvement, while Intel did. The difference fell to 8% only

Testing with requests that do not require database access, the number of requests per second were higher for both, and Graviton kept a good margin against Intel of 26%.

As a bonus, we decided to match the same instance type in the database. That means that now the m5.large EC2 instance is connected to a db.m5.large RDS instance and the m6g.large to a db.m6g.large RDS instance.

Results were pretty similar to before, with a 22% advantage to Gravitons, meaning that for this specific test, the database was not a bottleneck.

Final Thoughts

A simple change in your Dockerfile could mean a 40% cost reduction in your compute costs.

As M1 Macs become more popular, dev teams will be multi-platform, requiring environments (both local and cloud) to support different architectures.

Docker also is working on better support for multi-platform images with docker buildx, making it more portable and easier to use the most cost-effective computing platform, independent of architecture.

At DNX Solutions, we work to bring a better cloud and application experience for digital-native companies in Australia.

Our current focus areas are AWS, Well-Architected Solutions, Containers, ECS, Kubernetes, Continuous Integration/Continuous Delivery, and Service Mesh and Data Solutions (movement, transformation, lakes, warehouses and analytics).

We are always hiring cloud engineers for our Sydney office, focusing on cloud-native concepts.

Check our open-source projects at https://github.com/DNXLabs and follow us on Linkedin or Facebook.

Stay informed on the latest
insights and tech-updates

No spam - just releases, updates, and tech information.

Related Posts