Should You Use ARM or x86 Architecture For Your AWS Lambda Functions?
You’re always unsure of their differences and tradeoffs so you leave the default x86 — is this a good idea?
Most Lambda users tend to use the default settings when creating a Lambda function.
Usually, they do this because they do not know the nuances between different settings.
This is why knowledge is important when it comes to cloud services.
To optimize costs and performance, understanding the architecture settings of Lambda functions is essential.
This is what I’ll help you understand in this article.
Lambda’s Server Architectures
Lambda’s underlying servers use two different CPU processors:
ARM (Graviton processors)
x86 (intel/AMD processors)
ARM provides more energy-efficient compute power while x86, being older and more optimized offers wider compatibility.
ARM typically delivers better price-performance and uses less energy while keeping comparable computing power to x86.
x86 on the other hand has a wider software ecosystem support so it can be used with more libraries and programming languages.
While ARM supports fewer libraries and languages (more modern ones like Python, Node JS, etc), it does offer 20% cheaper Lambda function executions.
Choosing A Processor For Lambda Functions
Since ARM processors offer better price-performance — performance achieved relatively to the cost incurred — it is often a better choice when considering costs.
ARM processors typically deliver equivalent or better computing at a lower cost than x86 processors. So if you’re concerned about performance, ARM provides that as well.
Ultimately, ARM provides more computational value per dollar spent.
On the other hand, x86 may be a better choice based on the programming language or libraries you are using in your Lambda function.
Since x86 is older, it is supported by virtually every language and library. If you’re Lambda function uses an ARM-unsupported language or library, you will have to use x86 instead.
In terms of sustainability, x86 does have higher power consumption compared to ARM. I wrote about sustainability with AWS and how carefully choosing your cloud resources, and optimizing them can lead to more sustainable usage.
Pros and Cons of Each Processor
ARM processors can offer 20% cheaper Lambda costs and a similar performance output, but may not be supported with some older languages and libraries.
You can use Lambda’s Power Tuning Tool to estimate the best configuration for your Lambda functions if you want to get a better idea of ARM’s performance difference with x86.
On the other hand, x86 is well supported across all programming languages and libraries so you can use it in your Lambda functions without concern.
However, on the side of sustainability, x86 does use more power and consequently tends to cost a little more.
The Takeaway
For most general-purpose Lambda functions, switching to ARM processors will offer you performance and cost benefits with minimum friction.
Choose x86 when you have x86-specific libraries that you import in your Lambda functions.
The key for using ARM is to assess your usage and validate that all dependencies work and are supported.