Supercharging Rust Applications with AWS Graviton
Imagine slashing your AWS bill by up to 50% and improving energy efficiency in the process.
It probably sounds too good to be true, but that’s exactly what you can achieve by rethinking your approach to software performance.
Remember: software doesn't exist in isolation. Every line of code has a physical cost. Every request sent, calculation made, and inefficient algorithm consumes energy, contributing to the growing carbon footprint of our digital world.
As data centers demand more electricity, it's become increasingly clear that performance is a sustainability issue. But we can reduce energy consumption, cut our infrastructure costs, and build a more sustainable digital future by designing for maximum efficiency. This starts with making mindful choices about our tools, especially our programming languages and processors.
This is where a language like Rust enters the picture.
At its core, Rust gives developers the performance of traditional languages like C and C++ but with strong safety features that prevent common bugs and crashes. It achieves this without a garbage collector, a background process in many other languages that can slow things down. Rust compiles into incredibly efficient machine code by giving developers control over computer hardware and memory, making it the perfect choice for applications where performance matters.
But efficient software is only half the equation. This well-optimized code needs to run on equally efficient hardware to reduce costs and energy use. An incredibly fast engine still needs a lightweight, aerodynamic chassis to win.
Here's what we'll provide in today's newsletter:
An overview of AWS Graviton that traces each generation’s gains in performance per watt.
A reminder of why efficiency matters, linking every CPU cycle to energy use, emissions, and cost.
A look at how Rust delivers efficiency, thanks to zero-cost abstractions and strong safety guarantees.
Evidence from the field in GoDaddy’s migration and Cascadeo’s benchmarks, showing real savings.
A practical path forward with an ARM-native Rust workflow, so you can build and test without cross-compiling.
Graviton: A high-performance processor#
AWS Graviton processors are a family of custom-built CPUs designed by Amazon Web Services specifically for their cloud environment, Amazon EC2 (Elastic Compute Cloud). They are based on the ARM architecture, which differs from the more common x86 architecture used in most traditional servers.
ARM-based processors usually use less power. According to AWS, this results in lower energy bills for AWS and — crucially — a smaller carbon footprint for cloud applications.
Graviton3 instances consume up to 60% less energy while delivering equivalent performance as comparable instances. Additionally, the server design increases sockets/racks by 50% over other EC2 servers.
By combining Rust’s efficiency with Graviton’s hardware and cloud-level optimization, teams can build high-performance, cost-effective, and environmentally friendly systems from the application layer to the silicon.
4 evolutions of AWS Graviton#
Over the years, Graviton has evolved considerably to improve computer system performance. AWS has released four versions of Graviton to date:
Graviton1#
Graviton1, the first-generation Graviton processor, was launched in 2018. Based on the 64-bit ARM Cortex-A72 cores, it was designed for scale-out workloads like web servers and containerized microservices. While less powerful than later versions, Graviton1 demonstrated the potential of ARM in data centers.
Graviton2#
Graviton2 was introduced in 2019. It features 64-bit Arm Neoverse N1 cores, allowing it to significantly improve performance and efficiency over its predecessor. It offers up to 40% better price-performance than comparable x86-based instances.
Graviton2 proved that energy efficiency could coexist with strong performance, from high-performance computing to database applications. This generation was key in driving widespread adoption and building a robust ecosystem around Graviton.
Graviton3#
Building on the success of its predecessor, Graviton3 was announced in 2021. It utilizes more powerful Arm Neoverse V1 cores and DDR5 memory, delivering up to 25% better compute performance, twice the floating-point performance, and three times better machine learning performance than Graviton2.
It is ideal for demanding workloads like scientific computing, video encoding, and AI inference.
Graviton4#
The latest iteration, Graviton4, was announced in late 2023. With 96 Neoverse V2 cores and 12 channels of DDR5-5600 memory, Graviton4 offers a significant performance uplift across the board. Compared to Graviton3, it provides up to 30% better compute performance, 40% higher performance for databases, and 45% improved performance for large Java applications.
Despite each generation of Graviton offering better performance than the last version, AWS has not discontinued the previous versions of Graviton generations.
(Note: Graviton1 is no longer promoted by AWS, which means it’s available for use but considered outdated.)
Types of Graviton-based instances#
Graviton instances are available in all instance types, including general purpose, compute-optimized, memory-optimized, storage-optimized, and accelerated computing.
Here’s a breakdown of the AWS Graviton instances and their use cases:
Instance Type | Instance Name | Graviton Generation | Use Case |
General purpose | M8g | Graviton4 | Ideal for midsize data stores, microservices, and cluster computing |
General purpose | T4g | Graviton2 | Ideal for burstable general-purpose workloads |
Compute optimized | C8g | Graviton4 | Ideal for HPC, gaming, and CPU-based ML inferences |
Compute optimized | C7g, C7gd, C7gn | Graviton3, Graviton3E | Ideal for HPC, gaming, and CPU-based ML inferences |
Memory optimized | R8g | Graviton4 | Ideal for high-performance databases, big data analytics |
Memory optimized | X8g | Graviton4 | Ideal for open-source databases and in-memory caches |
Storage optimized | I8g | Graviton4 | Ideal for I/O intensive workloads for real-time analytics using Apache Spark |
Storage optimized | Is4gen | Graviton2 | Ideal for real-time analytics, search engines, and distributed systems |
Accelerate computing | G5g | Graviton2 | Ideal for graphic applications, including game streaming and ML inference |
AWS services supported by Graviton#
Multiple fully managed AWS services support Graviton-based instances to provide price-performance benefits.
Cascadeo, a premier tier AWS Partner and cloud-native consultancy, analyzed the cost and performance benefits of Graviton2-based Lambda functions compared to x86-based functions.
They deployed nearly 2,000 AWS Lambda functions across seven different runtimes for the analysis. To benchmark performance, they designed five workloads ranging from CPU-intensive, memory-intensive, and multi-threaded tasks to lightweight operations like writing data to Amazon DynamoDB.
Here are their key findings in terms of cost, performance, and workloads:
Graviton-based processors delivered 20% extra performance as compared to x86-based instances.
Graviton-based functions were 30% less costly as compared to x86-based functions.
Graviton-based functions could handle 50% more workload than x86-based functions.
By aggregating performance data across various workloads, they found that Graviton-based instances delivered significant gains, particularly in CPU-intensive scenarios. In simple terms, Graviton-based functions excel at compute-heavy tasks, offering faster execution and better efficiency than traditional x86 instances.
How GoDaddy migrated Rust applications to AWS Graviton#
GoDaddy offers a compelling case study.
The company migrated its entire ingress-proxy workload—written in Rust and Go—from x86 instances to AWS Graviton. Engineers rolled out the change in small increments, watching latency and throughput at each step. Rust’s built-in cross-compilation let them ship ARM and x86 binaries from the same codebase, removing the usual friction of a processor switch.
The payoff was substantial: cloud costs dropped by 40%, and performance improved by 20–50%, depending on the workload. With more headroom per instance, the team could ride out traffic spikes without launching extra servers—saving money, energy, and operational effort.
Setting up the environment for Rust development using Graviton#
The combination of Rust + AWS Graviton delivers exceptional performance and cost efficiency. However, developers often hit a common roadblock:
How can I natively develop ARM without dealing with cross-compilation and toolchain mismatches?
The infrastructure diagram below shows a solution for setting up an ARM-native Rust development environment.
The core principle of this architecture is to provide developers with a secure and low-latency connection to a powerful, cloud-based development workspace running directly on a Graviton EC2 instance.
This setup enables a secure, low-latency Rust development environment on AWS using Graviton-based EC2 instances. Developers write and test code directly on ARM64, avoiding cross-compilation issues. Global Accelerator ensures fast, responsive access, while the Application Load Balancer handles secure traffic routing with TLS. AWS Secrets Manager manages credentials safely, and Coder server provides a browser-based IDE preconfigured with the Rust toolchain. rust-analyzer, and a debugger, offering a seamless, production-ready developer experience.
With this architecture, development teams can leverage the performance benefits of Rust on Graviton.
Wrapping up#
The combination of Rust and AWS Graviton represents a perfect synergy between efficient software and hardware. Rust provides control over system resources and compiles down to lean, high-performance machine code, while Graviton provides a processor architecture designed from the ground up to execute that code with maximum performance per watt.
This powerful duo allows businesses to reduce cloud infrastructure costs and build faster, more resilient, and energy-efficient applications.
Cloud Labs provide instant, hands-on access to real AWS services without the hassle of billing, provisioning, or cleanup. Whether you’re learning about serverless architecture, scalable storage, or distributed databases, you can experiment confidently in a sandboxed environment built for learning.
Here are a few great resources for you to explore these concepts further: