What is a Graviton migration, and why do the savings rarely match the price gap?
A Graviton migration moves backend services from x86 EC2 instances (or x86 containers on ECS, EKS, or Lambda) to AWS Graviton processors, which use the arm64 architecture. Your code doesn't change much. The build chain does: every container image, native dependency, and base image must exist for arm64. Teams migrate because Graviton instances usually cost less per hour than comparable x86 instances and often deliver more work per watt.
The headline price gap applies only to part of your bill, and other costs eat into it:
- Compute share. Storage, data transfer, managed databases you can't switch, and support plans see none of the discount.
- Performance parity. If arm64 needs more instances for the same throughput, the hourly discount shrinks or reverses.
- Existing commitments. Reserved Instances or instance-family-specific Savings Plans tied to x86 keep billing until they expire.
- Build costs. Multi-arch CI adds runner time and maintenance.
Illustrative estimate (assumed numbers, not a benchmark)
Net monthly savings = Bill × Compute share × Migratable fraction × Price delta × Parity factor − Added build cost
Assumptions:
- Monthly bill: $100,000
- Compute share: 40%
- Migratable fraction: 70%
- Price delta: 20%
- Parity factor: 1.0
- Added CI cost: $400 per month
Calculation: $100,000 × 0.4 × 0.7 × 0.2 × 1.0 − $400 = $5,200 per month
In this illustrative estimate, that is about 5% of the total bill, not 20%. Now assume, as a further illustrative input rather than a measured result, that you need 10% more arm64 instances to match x86 throughput. The arm64 fleet then costs 0.80 × 1.10 = 0.88 of the x86 fleet, so the effective discount is 12% instead of 20% and the parity factor is 0.6. The illustrative savings fall to $100,000 × 0.4 × 0.7 × 0.2 × 0.6 − $400 = about $2,960 per month.
How do you build an honest graviton migration savings model?
Start by pulling instance compute out of the bill. Data transfer, storage, managed databases and load balancers do not change when you switch CPU architecture. As an illustrative example with assumed inputs, a 12% compute saving on a bill that is 40% compute moves the total by under 5%.
Next, price capacity, not vCPUs. Let R be the number of arm64 instances you need per x86 instance to serve the same load at the same latency target. Measure R from your own load tests.
Then check commitments. Savings Plans that are not tied to an instance family usually follow the workload to Graviton. Reserved Instances, family-specific plans and capacity reservations do not. You keep paying for the x86 commitment until it expires, so realized savings start at the expiry date, not the cutover date.
Illustrative estimate (assumed numbers, not a benchmark)
Formula: net = N·H·(P_x86 − R·P_arm) − C_ci
| Input | x86 | arm64 |
|---|---|---|
| Instances (N, then N·R) | 100 | 105 (R = 1.05) |
| Hourly price (assumed) | $0.20 | $0.16 |
| Monthly compute (730 h) | $14,600 | $12,264 |
| Added CI cost (assumed) | — | $300 |
| Net monthly saving | — | $2,036 (~14% of compute) |
With an assumed total bill of $36,500, that saving is about 5.6% of the bill.
After cutover, do not compare monthly bill totals, because traffic growth and seasonality hide the effect. Compare compute cost per request (or per job) over the same traffic window, such as the same weekday hours, with x86 and arm64 pools running side by side. This shows whether your measured R holds under production traffic.
Why are per-vCPU comparisons misleading, and how should you benchmark arm64?
On most x86 instance families, a vCPU is one hardware thread, and two vCPUs share a physical core through simultaneous multithreading. A Graviton vCPU is a full physical core with no sibling thread competing for its execution units or caches. Two Graviton vCPUs and two x86 vCPUs are therefore different amounts of hardware. How much that matters depends on the workload. Code that stalls on memory or I/O gains a lot from hyperthreading on x86. Compute-dense code that would saturate a core gains less. A per-vCPU price comparison treats these cases as equal, and they are not.
A benchmark that predicts production
Measure throughput at a fixed operating point instead of at saturation:
- Replay realistic load. Use a production traffic mix, real payload sizes and warm caches. Synthetic loops do not exercise the same code paths.
- Hold CPU at your target utilization, such as the level your autoscaler targets. Then record requests per second, p50 latency and p99 latency on both architectures.
- Benchmark before you resize. Compare the same instance size first. Pick the smaller size only after you know the per-instance ratio.
Where parity can fail
Some libraries ship hand-tuned x86 SIMD paths and fall back to slower generic code on arm64. Specific cryptography, compression and hashing routines can behave this way. JIT-compiled runtimes can also inline, vectorize or tier code differently on each architecture. Profile any hot path that shows a regression.
Extra instances reduce the savings quickly. Illustrative estimate: assume a 20% lower hourly price and a workload that needs 15% more instances to hold p99. The fleet then costs 0.80 × 1.15 = 0.92 of the original, which is 8% savings, not 20%.
Which workloads should migrate first, and when should you avoid migrating?
Start with services whose runtime already abstracts the CPU. JVM, Go, Node.js and pure-Python services usually move with little more than a rebuild, because the bytecode, interpreter or cross-compiled binary is the only architecture-specific part. The risk sits in anything compiled ahead of time for x86 that you don't control.
| Workload trait | Typical effort | Why |
|---|---|---|
| JVM, Go, Node.js, pure Python | Low | Runtime or compiler targets arm64 directly |
| Native extensions (npm addons, C-backed wheels) | Audit | Need an arm64 build or a source compile |
| Prebuilt binaries in the image | Audit | Often downloaded as x86-only artifacts |
| Closed-source agents | Audit, possibly blocking | Only the vendor can ship arm64 |
| x86 SIMD intrinsics (SSE/AVX) | Rewrite or fallback | No direct arm64 equivalent; needs NEON or generic path |
Audit the whole dependency chain: base images, OS packages, native wheels, sidecars, and observability and security agents. Agents are the usual blocker because they run on every node. If an image has no arm64 variant, the result at pull time depends on how it was published. A multi-arch manifest without an arm64 entry fails with a "no matching manifest" error. A single-arch amd64 image can pull and then crash with "exec format error". In Kubernetes, that crash shows up as a pod restart loop rather than an obvious build failure.
Postpone the migration in these cases:
- The fleet is small enough that engineering time outweighs the savings.
- Compute is a minor line item.
- A required vendor agent has no arm64 build.
- Graviton instance types aren't available in your regions or zones.
- Your committed spend is tied to x86 instance families and won't apply to Graviton.
How do you produce arm64 Docker images with multi-arch builds?
Most official base images are already published as multi-arch manifest lists. A manifest list is an index that maps one tag to several platform-specific images. When a Graviton node pulls an image, the runtime picks the linux/arm64 entry, and an x86 node gets linux/amd64. Your job is to make your own images work the same way, so deployment manifests keep using a single tag on both architectures.
Remove hardcoded architecture strings
The usual blocker is a Dockerfile that downloads a release binary from a URL containing amd64 or x86_64. That build succeeds on arm64 but produces an image that fails at runtime with an exec format error.
To fix it, declare ARG TARGETARCH and interpolate it into the URL. BuildKit sets this argument per platform to values like amd64 and arm64. Some upstream projects name their assets x86_64 and aarch64 instead, so you may need a small case mapping before the download. Also check checksum files, because they usually differ per architecture.
Build and push both platforms
Run docker buildx build --platform linux/amd64,linux/arm64 -t <registry>/<image>:<tag> --push . to build both variants. Buildx pushes them under one manifest list. Pushing is the normal path because the classic local image store generally holds only a single platform per tag.
Local development differs from production
Engineers on arm64 laptops already build and run arm64 images natively. That can hide amd64-only problems until CI runs. Engineers on x86 laptops face the opposite problem: they need QEMU emulation to build or run arm64 images, which is slow and can mask native behavior. Treat CI's native per-platform builds and tests as the source of truth, not either kind of laptop.
FROM debian:bookworm-slim
ARG TARGETARCH
ARG TOOL_VERSION=1.2.3
ARG TOOL_BASE_URL
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
RUN set -eux; \
# Upstream names its assets x86_64/aarch64, so map from Docker's names
case "${TARGETARCH}" in \
amd64) ARCH=x86_64 ;; \
arm64) ARCH=aarch64 ;; \
*) echo "unsupported arch: ${TARGETARCH}" >&2; exit 1 ;; \
esac; \
ASSET="tool-linux-${ARCH}.tar.gz"; \
curl -fsSL -o /tmp/tool.tar.gz "${TOOL_BASE_URL}/v${TOOL_VERSION}/${ASSET}"; \
# Each architecture has its own checksum, so fetch the matching one
curl -fsSL -o /tmp/tool.sha256 "${TOOL_BASE_URL}/v${TOOL_VERSION}/${ASSET}.sha256"; \
echo "$(cut -d' ' -f1 /tmp/tool.sha256) /tmp/tool.tar.gz" | sha256sum -c -; \
tar -xzf /tmp/tool.tar.gz -C /usr/local/bin tool; \
rm /tmp/tool.tar.gz /tmp/tool.sha256; \
# Fail the build now instead of hitting an exec format error at runtime
tool --version
ENTRYPOINT ["/usr/local/bin/tool"]
A Dockerfile that uses TARGETARCH and a case mapping to download and verify the correct per-architecture binary, with the buildx command that pushes linux/amd64 and linux/arm64 under one manifest-list tag.
What are the alternatives for multi-arch CI, and what do they cost in build time?
You can produce arm64 artifacts in CI in three ways. Each one trades build time against infrastructure you have to operate.
| Approach | Build speed | Operational cost | Main risk | Best fit |
|---|---|---|---|---|
| QEMU emulation | Slow for compile-heavy steps, tolerable for copy-only layers | Lowest, because it runs on existing x86 runners | Emulation-only failures and flakiness that never reproduce natively | Interpreted runtimes, thin images |
| Native arm64 runners | Close to x86 | Highest: another pool to patch, scale and cache | Drift between the arm64 and x86 runner configs | Compiled code, native extensions, full test suites |
| Cross-compilation | Fast, on x86 | Low | Toolchain and cgo setup, and you still need arm64 hardware to run tests | Go with GOARCH=arm64 and cgo disabled |
Every option roughly doubles your build and test work. Building on arm64 is not enough, so run the test suite there too. A binary that compiles for arm64 can still behave differently there, because memory ordering, unaligned access and native dependencies can differ from x86.
Illustrative estimate (assumed numbers, not a benchmark). Added CI cost per month = (builds × arm64 minutes per build × cost per minute) + (runner upkeep hours × hourly engineering rate). With 3,000 builds, 12 minutes each, $0.01 per minute, and 4 hours of upkeep at $100 per hour: $360 + $400 = $760 per month. Subtract this from the compute savings in your model.
Put multi-arch in the shared pipeline templates so it is the default. Every new service then ships both architectures from its first commit. Portability regressions show up in pull requests instead of during rollout, and moving a service to arm64 becomes a scheduling change rather than a separate migration project for each team.
#!/usr/bin/env bash
set -euo pipefail
APP=./cmd/orders-api # placeholder main package
PKG=./internal/orders # placeholder package with the core tests
OUT=dist
mkdir -p "$OUT"
for arch in amd64 arm64; do
CGO_ENABLED=0 GOOS=linux GOARCH="$arch" \
go build -trimpath -o "$OUT/orders-api-linux-$arch" "$APP"
done
GOARCH=arm64 go vet ./...
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 \
go test -c -race=false -o "$OUT/orders.arm64.test" "$PKG"
if [ "$(uname -m)" = "aarch64" ]; then
# -test.count=1 bypasses caching. -test.v makes failures easy to compare with x86.
"$OUT/orders.arm64.test" -test.v -test.count=1
else
# On x86, run the normal suite natively.
go test ./...
fi
A shared CI script that cross-compiles a Go service for amd64 and arm64 on x86, and then runs the test suite natively on each architecture, because a successful arm64 build alone does not prove the code works there.
How do you roll out Graviton safely with mixed-architecture fleets?
Run both architectures side by side and move workloads one at a time. In Kubernetes, that means separate x86 and arm64 node groups in the same cluster. On ECS, it means separate capacity providers. Nothing moves until a service explicitly opts in.
| Layer | x86 pool | arm64 pool |
|---|---|---|
| Nodes | Existing instance families | Graviton families |
| Label | kubernetes.io/arch: amd64 |
kubernetes.io/arch: arm64 |
| Workloads | Everything not yet migrated | Opted-in services, canaries |
Start by giving a service two Deployments behind the same Service. The main one keeps a nodeSelector on amd64. The canary pins to arm64 and gets a small replica count, so it takes a proportional slice of traffic. Compare latency, error rate and CPU per request between the two before shifting replicas over.
Both Deployments reference the same multi-arch tag, so rolling back takes one edit. Flip the selector, or scale the arm64 Deployment to zero, and pods reschedule onto x86 without a rebuild or a new image.
The mixed fleet carries ongoing costs:
- Constraint drift. A missing selector lets the scheduler place a pod on either architecture. That is harmless for multi-arch images but breaks single-arch ones. Make the arch label a required field in your templates or admission policy.
- Arch-specific debugging. Bug reports now need "which architecture?" as a first question. Put the node's arch label in logs and metrics so you can split dashboards by it.
- Spot diversification. Spot pools should span several instance families within each architecture. Each architecture is its own capacity pool, so an arm64-only service has fewer fallback families than one that can run anywhere.
apiVersion: apps/v1
kind: Deployment
metadata:
name: checkout-arm64
labels:
app: checkout
track: canary
spec:
replicas: 1 # small slice next to e.g. 9 amd64 replicas
selector:
matchLabels:
app: checkout
track: canary
template:
metadata:
labels:
app: checkout # matched by the shared Service, so it gets traffic
track: canary # lets dashboards split canary vs main
spec:
nodeSelector:
kubernetes.io/arch: arm64 # rollback: scale to 0 or change to amd64
containers:
- name: checkout
# Same multi-arch tag as the amd64 Deployment; the runtime pulls
# the matching platform from the manifest list.
image: registry.example.com/checkout:1.42.0
env:
- name: NODE_NAME # tag logs/metrics with the node so arch
valueFrom: # can be joined from node labels
fieldRef:
fieldPath: spec.nodeName
resources:
requests:
cpu: 500m
memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
name: checkout
spec:
selector:
app: checkout # no arch or track label: spans both Deployments
ports:
- port: 80
targetPort: 8080
An arm64 canary Deployment and an amd64 main Deployment share one Service and one multi-arch image tag, so traffic splits by replica count and rollback is a single selector or replica edit.
How OneEnv can help
Disclosure: OneEnv is the product behind this blog.
OneEnv (oneenv.io) is a workspace-based governance platform for the things services share — environment variables, database structure, API routes and validation rules. A change to a shared value is staged on a branch, reviewed once, and then every affected service explicitly approves or rejects it before it goes live, so you can see who a change touches before it ships instead of finding out in production.
Applied to graviton migration savings, this is where it helps:
Saves time
- Every service that inherits a shared value is listed in one place, so nobody searches repos and chats to find out who is affected.
- One review per branch replaces coordinating each team separately; each service still keeps its own approve/reject.
- Reviewers see the exact diff and the list of affected services up front, so approval is a decision rather than an investigation.
Saves cost
- Fewer production incidents and rollbacks caused by a shared value, route or column changing under a consumer unannounced.
- Less duplicated configuration to maintain: one shared definition inherited by many services.
- Per-service approve/reject means a bad shared value can be refused where it would break something, before it is live.
- OneEnv has a free plan (1 workspace, unlimited services and members, full governance), so trying it costs nothing.
These are qualitative benefits, not measured results — how much you save depends on how many services share the value.
Want to try it? Start at oneenv.io.