What is a Graviton migration, and why is hourly price the wrong savings metric?

Graviton is AWS's line of ARM-based processors, offered as arm64 instance families alongside the x86 ones (look for a "g" in the family name). Migrating a backend service means more than changing an instance type. You need arm64 builds of your code, its native dependencies, its container images and its base images. You also need a CI pipeline that produces those artifacts and a rollout that proves the service still meets its latency targets.

The usual pitch is a lower hourly price, but a lower hourly price is not the same as a lower bill. What you pay for is work done within your SLO: requests served, jobs completed or GB processed. The metric that matters is:

Cost per million requests = hourly price ÷ (sustained req/s at your p99 target × 3,600) × 1,000,000

Illustrative estimate (assumed numbers, not a benchmark). Assume an x86 instance costs $0.20/h and sustains 1,000 req/s at your p99 target. Assume the Graviton equivalent costs 20% less, at $0.16/h.

Scenario Graviton req/s at p99 target Cost per million requests Savings vs x86 ($0.0556)
Better throughput (1.15×) 1,150 $0.0386 ~30%
Equal throughput (1.0×) 1,000 $0.0444 20%
Worse throughput (0.8×) 800 $0.0556 0%

Fleet sizing makes the worse case even less favourable. Suppose you need 10,000 req/s. That takes 10 x86 instances at $2.00/h. At 800 req/s each, it takes 13 Graviton instances (12.5 rounded up), which cost $2.08/h. If you have to move to a larger Graviton size to hold latency, the cheaper hourly price stops being an advantage.

Which workloads should you migrate to Graviton first, and when should you avoid it?

Start with services where the compiler or runtime already does the porting for you. Python, Node.js, Java, Go and .NET code that stays inside its runtime usually needs only an arm64 base image and a rebuild, because the interpreter, JIT or compiler emits ARM instructions. The effort moves to anything that ships machine code directly. Native extensions, vendored binaries and CGO dependencies must each have an arm64 build. Hand-tuned x86 paths, such as SIMD intrinsics, inline assembly, or crypto and compression libraries optimized for x86 instruction sets, may compile with a generic fallback and run slower until someone reoptimizes them.

Workload type Typical porting effort Main risk
Pure Python, Node.js, Java, Go, .NET Low Base image or build tooling assumes amd64
Native extensions, CGO, vendored binaries Medium Missing arm64 builds, mismatched libc
SIMD intrinsics, assembly, tuned crypto/compression High Silent fallback to slow generic code

When to delay

  • Blocking third-party software. A monitoring agent, security scanner or closed-source binary without an arm64 build stops the migration until the vendor ships one.
  • Committed x86 spend. Reserved Instances or Savings Plans tied to specific x86 instance families keep billing you for that capacity. Moving workloads off it means paying twice until the commitment expires.
  • Spot-heavy fleets. If you already run on discounted Spot capacity, the Graviton gain is smaller. Spreading the fleet across two architectures also shrinks the pools you can draw interruption-tolerant capacity from.
  • No capacity to finish. A half-migrated fleet still needs dual builds, dual testing and dual AMIs, but saves only part of the money.

How do you audit dependencies for arm64 support before touching infrastructure?

Start with an inventory, not a test cluster. A migration fails at the component nobody listed, so walk every image layer and every process that runs beside your service:

  • Base images. For each FROM line, run docker buildx imagetools inspect <image:tag> and confirm the manifest list includes linux/arm64. docker manifest inspect shows the same data as raw JSON. A single-platform manifest means that tag is x86-only, even if other tags of the same image support arm64.
  • OS packages. Distribution repositories usually build for aarch64, but vendor repositories added with an extra apt or yum source often do not.
  • Language packages with native code. These cause the most failures. In Python, check that each compiled dependency publishes an aarch64 wheel. If it doesn't, pip falls back to building from source, which needs a compiler in the image. In Node.js, look for binding.gyp files or install scripts that download prebuilt binaries. In Java, look for JARs that bundle .so files for JNI. In Go, look for cgo.
  • Sidecars and agents. Check monitoring, logging, security and service-mesh components. A missing arm64 agent can block an entire node pool.
  • Baked-in binaries. Look for curl-downloaded CLIs and tools whose download URLs hardcode amd64 or x86_64.

When a component has no arm64 build, you have three options:

  • Wait if the upstream project has it on a public roadmap.
  • Replace the component if an equivalent tool already supports arm64.
  • Build from source only if you accept the ongoing maintenance cost. Every rebuild becomes yours to patch.
#!/usr/bin/env bash
# Pre-migration arm64 audit. Read-only: it changes no infrastructure.
set -euo pipefail

# 1. Base images and sidecars: does each exact tag publish linux/arm64?
for image in python:3.12-slim node:20-bookworm-slim registry.example.com/platform/log-agent:2.3.1; do
  # A manifest list or OCI index has .manifests[]; a single-platform manifest has none.
  arches=$(docker manifest inspect "$image" \
    | jq -r '.manifests[]?.platform | "\(.os)/\(.architecture)"' | sort -u)
  if grep -qx 'linux/arm64' <<<"$arches"; then
    echo "OK    $image"
  else
    echo "MISS  $image  (no linux/arm64 entry; check with: docker buildx imagetools inspect $image)"
  fi
done

# 2. Python: try to resolve every pinned dependency as a prebuilt aarch64 wheel only.
# A failure names the package that would need a source build on arm64.
pip download -r requirements.txt -d /tmp/arm64-wheels \
  --only-binary=:all: --platform manylinux2014_aarch64 \
  --python-version 3.12 --implementation cp \
  || echo "At least one package has no aarch64 wheel (see pip error above)"

# 3. Native code already present in the current x86 build.
# Compiled Python extensions, grouped by top-level package:
find /usr/local/lib/python3.12/site-packages -name '*.so' \
  | sed -E 's#.*/site-packages/([^/]+)/.*#\1#' | sort -u
# Node.js addons compiled with node-gyp:
find node_modules -name binding.gyp -printf '%h\n' 2>/dev/null | sort -u
# JARs bundling JNI shared libraries:
for jar in target/lib/*.jar; do
  unzip -l "$jar" | grep -q '\.so$' && echo "JNI: $jar"
done
# Go packages (including dependencies) that use cgo:
go list -deps -f '{{if .CgoFiles}}{{.ImportPath}}{{end}}' ./... | sed '/^$/d'

# 4. Baked-in binaries whose download URLs hardcode the architecture.
grep -rnE 'amd64|x86_64' Dockerfile* scripts/ || true

A read-only audit script that checks image tags for a linux/arm64 manifest entry, tests whether Python dependencies resolve to aarch64 wheels, lists native extensions in Python, Node.js, Java and Go trees, and flags download URLs that hardcode x86.

How do multi-arch builds and arm64 Docker images work?

docker buildx build runs your Dockerfile once per target platform and produces a separate image for each. It then publishes a manifest list (an OCI image index) that maps each platform to its image digest. Pass both targets with --platform linux/amd64,linux/arm64 and add --push. The classic local image store holds only one architecture per tag, so the combined result normally goes straight to a registry.

At pull time, the container runtime reads the index and fetches only the entry that matches the node:

  • registry/app:1.4 → manifest list
    • linux/amd64 → image digest A → pulled by x86 nodes
    • linux/arm64 → image digest B → pulled by Graviton nodes

Your deployment manifests keep one tag, and mixed node pools work without per-architecture image names.

The Dockerfile is usually where multi-arch builds break. A line like curl -L .../tool-linux-amd64.tar.gz builds fine for arm64 and silently ships an x86 binary. Declare ARG TARGETARCH (and ARG TARGETPLATFORM if you need the full linux/arm64 string) inside the stage that uses them, and interpolate the value into the URL. Many projects name artifacts x86_64/aarch64 rather than amd64/arm64, so map the value with a shell case statement.

Then add a verification step, for example file /usr/local/bin/tool | grep -q aarch64 for arm64 builds. Don't rely on uname -m or on running tool --version for this. Under QEMU emulation, both report the emulated platform and a wrong-architecture binary may still execute. Inspecting the file header catches the mismatch at build time, before it reaches a node.

# syntax=docker/dockerfile:1
# Build both platforms and push one tag that resolves to a manifest list:
#   docker buildx build --platform linux/amd64,linux/arm64 \
#     -t registry.example.com/app:1.4 --push .
FROM debian:bookworm-slim

# BuildKit sets these per platform. They must be declared in the stage that uses them.
ARG TARGETARCH
ARG TARGETPLATFORM
ARG TOOL_VERSION=1.2.3

RUN apt-get update \
 && apt-get install -y --no-install-recommends curl ca-certificates file \
 && rm -rf /var/lib/apt/lists/*

RUN set -eu; \
    # Map Docker arch names to the upstream artifact names and to the string
    # that `file` prints for an ELF binary of that architecture.
    case "$TARGETARCH" in \
      amd64) ARCH=x86_64;  EXPECT='x86-64' ;; \
      arm64) ARCH=aarch64; EXPECT='aarch64' ;; \
      *) echo "unsupported TARGETARCH: $TARGETARCH" >&2; exit 1 ;; \
    esac; \
    echo "building for $TARGETPLATFORM, fetching $ARCH artifact"; \
    # No hardcoded amd64/x86_64 in the URL: the arch comes from the build arg.
    curl -fsSL -o /tmp/tool.tar.gz \
      ""; \
    tar -xzf /tmp/tool.tar.gz -C /usr/local/bin tool; \
    rm /tmp/tool.tar.gz; \
    # Check the ELF header, not `uname -m` or `tool --version`, which can
    # report the emulated platform under QEMU. A mismatch fails the build here.
    INFO="$(file -L /usr/local/bin/tool)"; \
    echo "$INFO"; \
    echo "$INFO" | grep -q "$EXPECT" \
      || { echo "wrong architecture: expected $EXPECT" >&2; exit 1; }

ENTRYPOINT ["/usr/local/bin/tool"]

A Dockerfile, built with buildx for linux/amd64 and linux/arm64, that picks the download URL from TARGETARCH and fails the build if the downloaded binary's ELF header does not match the target architecture.

QEMU emulation or native ARM runners: which CI build strategy fits?

The build strategy determines how long each pipeline takes, so it affects every engineer's wait time, not just the CI bill. There are three realistic options.

QEMU emulation runs arm64 instructions on your existing x86 runners. Setup is minimal: register the emulator with binfmt and request an extra platform in your multi-arch build. The cost is speed. Interpreted layers such as package installs are tolerable, but anything that compiles native code (C extensions, node-gyp modules, Rust crates) runs many times slower. Some toolchains also crash or time out under emulation in ways that never happen on real hardware.

Native arm64 runners build at full speed and run your test suite on the production architecture. You pay for this with more infrastructure: a second runner pool, separate caching, and capacity planning for two architectures.

Cross-compilation produces arm64 binaries on x86 without emulation when the toolchain supports it. Go is the simplest case: set GOOS=linux and GOARCH=arm64 and the build is fast. The resulting binary still has to be tested on arm64.

Strategy Build speed CI infrastructure Runs tests on arm64 Main risk
QEMU emulation Slow for native compilation None added Emulated only Timeouts, emulator-only failures
Native arm64 runners Fast Second runner pool Yes, natively Operating two pools
Cross-compilation Fast None added No Untested binary

Developer laptops may be ARM or x86, and neither tells you how the code behaves in production. Whichever strategy builds the image, at least one CI stage should run the tests on native arm64 before deploying.

How should you benchmark Graviton performance against x86?

Benchmark at the instance sizes you would actually deploy, driven by replayed or synthetic production traffic rather than microbenchmarks. Ramp load until the service reaches its latency SLO, then record throughput at that point, along with p50 and p99 latency and CPU utilization. Throughput at SLO is the number the cost model needs. Peak throughput with p99 out of bounds is not capacity you can sell.

Service profile What dominates What to watch on Graviton
Compute-bound Instruction throughput, vectorized code paths Whether hot libraries have optimized arm64 code paths; gains can be large or absent
Memory-bound Cache and memory bandwidth Working-set fit in cache; p99 under GC or allocation pressure
I/O-bound Network, disk, downstream calls Little throughput change; savings come mostly from price and smaller instances

Feed the result back as cost per request: hourly price divided by sustained requests per hour at SLO, computed for each architecture. If throughput drops more than the price does, the migration loses money despite the cheaper instance.

Expect to retune after migration. Graviton vCPUs are physical cores without simultaneous multithreading. Utilization therefore tends to scale more linearly toward high percentages, and an autoscaling threshold tuned on x86 may scale out too early. Revisit JVM heap and GC thread settings, which the runtime derives from visible processors and memory. Resize thread pools against measured p99 rather than core count. Then right-size: the benchmark may show that a smaller instance meets the same SLO.

How do you roll out Graviton incrementally and calculate payback time?

Run both architectures side by side

Keep x86 and arm64 capacity in the same cluster. In Kubernetes, add a separate arm64 node group, taint it, and give only migrated workloads the matching toleration plus a nodeSelector of kubernetes.io/arch: arm64. Use node affinity if you want arm64 as a preference rather than a hard requirement. In ECS, put each architecture in its own capacity provider and set the CPU architecture in the task definition. Move traffic in steps, for example one replica, then a quarter of replicas, then half. At each step, compare error rate, p99 latency and cost per unit of work. To roll back, remove the selector or change the capacity provider weights so tasks return to x86. Keep the x86 node group running until you are done.

Common failures

  • exec format error and crash-looping pods. An amd64-only image or binary was scheduled onto an arm64 node. This usually means one image tag was never pushed as a multi-arch manifest.
  • Unrelated pods landing on arm64 nodes. This happens when the arm64 node group has no taint. Any pod without an architecture constraint can be scheduled there.

Payback estimate

Illustrative estimate (assumed numbers, not a benchmark):

Payback months = one-time cost ÷ (monthly savings − ongoing monthly cost)

  • One-time cost: 120 engineer-hours × $100/hour = $12,000
  • Monthly savings: a $8,000 monthly compute bill × an assumed 20% drop in cost per request = $1,600
  • Ongoing monthly cost: $300 for longer or duplicated CI builds, a second architecture in the test matrix, and maintaining two image variants
  • Payback: $12,000 ÷ $1,300 ≈ 9.2 months

The engineering-hours figure falls for later services. Write a runbook for the first migration and add CI checks that reject single-architecture manifests. Each later service then reuses that work instead of rediscovering the same problems.

# Canary Deployment pinned to the tainted arm64 node group.
# The x86 Deployment keeps running alongside it; scale this one up in steps.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: orders-api-arm64
spec:
  replicas: 1                      # step 1: a single replica, then grow
  selector:
    matchLabels:
      app: orders-api
      arch: arm64
  template:
    metadata:
      labels:
        app: orders-api            # shared label so the Service sends traffic to both variants
        arch: arm64
    spec:
      # Hard requirement: only schedule on arm64 nodes.
      nodeSelector:
        kubernetes.io/arch: arm64
      # Matches the taint on the arm64 node group, e.g. arch=arm64:NoSchedule.
      # Pods without this toleration stay off arm64 nodes.
      tolerations:
        - key: arch
          operator: Equal
          value: arm64
          effect: NoSchedule
      containers:
        - name: orders-api
          # Must be a multi-arch manifest (or an arm64 image).
          # An amd64-only image here causes exec format error and CrashLoopBackOff.
          image: registry.example.com/orders-api:1.4.2
          resources:
            requests:
              cpu: 500m
              memory: 512Mi
# Rollback: kubectl scale deployment orders-api-arm64 --replicas=0
# The x86 Deployment continues serving all traffic.

A canary arm64 Deployment that runs only on the tainted arm64 node group via the kubernetes.io/arch nodeSelector and a matching toleration, alongside the existing x86 Deployment, with scaling to zero as the rollback path.

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 aws graviton migration cost 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.