What does Graviton vs x86 cost actually mean for a backend service?

Graviton is AWS's own family of arm64 processors, offered as EC2 instance types. You don't pick "Graviton" as a separate product. You pick an instance family whose name includes a g after the generation number: m7g is the general-purpose Graviton counterpart to m7i (Intel), and c7g is the compute-optimized counterpart to c7i. Read the name as family letter, generation, then processor suffix. That makes the x86 sibling easy to find.

Instance Architecture vCPU Memory What a vCPU is
m7g.xlarge arm64 (Graviton) 4 16 GiB Physical core
m7i.xlarge x86 (Intel) 4 16 GiB Hyperthread (2 per core)
c7g.xlarge arm64 (Graviton) 4 8 GiB Physical core
c7i.xlarge x86 (Intel) 4 8 GiB Hyperthread (2 per core)

A fair comparison holds vCPU count and memory constant, so the only variable is the processor. Matching vCPUs alone is not enough, because a vCPU means different things on each side. On most current x86 instances, a vCPU is one hyperthread, and two vCPUs share one physical core's execution units. On Graviton, each vCPU is a full core. AMD's 7th-generation families, such as m7a, also map a vCPU to a physical core, so check this before assuming.

This matters most under load. When both hyperthreads on a core are busy, they compete for that core's execution units. As a result, per-vCPU throughput on x86 tends to flatten as utilization climbs, and tail latency rises earlier. CPU-bound and latency-sensitive services usually hit that ceiling first.

On cores without SMT, scaling is often closer to linear up to high utilization. That can change where you set autoscaling thresholds, and it is the reason to measure work per instance rather than compare hourly prices.

How do you calculate cost per unit of work instead of cost per hour?

Hourly price is only an input. What you buy is work done within your latency target, so first define a unit of work: requests per second sustained at your p99 SLO for an API, or jobs per hour for a batch worker. Load test both architectures at the same instance size with the same build flags and traffic mix. Raise the load until p99 breaches the SLO, then record the highest throughput that held.

Cost per million requests = hourly price ÷ (sustained RPS × 3,600) × 1,000,000

Illustrative estimate (assumed numbers, not a benchmark). Assume x86 at $0.100/h sustaining 1,000 RPS, and Graviton at $0.080/h.

Instance Assumed $/h Sustained RPS at p99 SLO $ per million requests
x86 0.100 1,000 0.0278
Graviton (throughput drops) 0.080 750 0.0296
Graviton (parity) 0.080 1,000 0.0222
Graviton (throughput rises) 0.080 1,200 0.0185

In this illustrative estimate, with the assumed prices above, the instance with a 20% lower hourly price becomes more expensive per request once its throughput falls by more than 20%. This follows from the formula, not from any measurement: the cheaper instance only wins while its throughput ratio stays above its price ratio.

Next, check the rest of the bill:

  • Commitments. Compute Savings Plans apply across instance families. EC2 Instance Savings Plans and Standard Reserved Instances are tied to a family, so migrating can leave existing commitments stranded until they expire.
  • Spot. Spot pricing and interruption rates vary by instance type and Availability Zone. Check the history for the specific pools you would use.
  • Managed services. RDS, ElastiCache and Lambda (arm64) offer Graviton options, and these often save money with less migration work than your own code.

Pull current EC2 pricing for your region. Do not rely on a fixed percentage.

Which backend services benefit from arm64, and when should you avoid migrating?

The strongest candidates are stateless, CPU-bound services written in Go, Java, Node.js or Python, backed by CI that already runs your test suite on every commit. These runtimes ship first-class arm64 builds, and the compiler or JIT handles most architecture differences, so your own code rarely changes. Statelessness matters because you can drain and replace instances freely. Mature CI matters because it is where arm64 regressions surface before production.

Workload trait Good fit for arm64 Avoid or defer
Runtime Go, JVM, Node.js, CPython with pure-Python deps Heavy native extensions, vendor-only x86 binaries
Hot path Request handling, serialization, business logic Hand-tuned x86 SIMD in compression, crypto or media code
Concurrency Many parallel requests across cores Single-threaded hot loops that depend on peak per-core speed
Fleet profile Large, steadily loaded, CPU-bound Small, mostly idle or memory-bound

Defer migration when a hot path relies on x86 intrinsics or on libraries whose arm64 code paths are less optimized. A generic fallback can erase the per-hour discount. Small or idle fleets are a poor fit for a different reason. The absolute savings are small and will not repay the engineering time. Memory-bound services gain little because you pay mostly for RAM, not cores.

Check capacity before you plan around it. Graviton instance families are not available in every region or Availability Zone, and prices vary by region. Finally, the price-performance data you collect only applies to AWS. Your multi-arch images will still run on other clouds or on-prem arm64 hardware, but your cost model and capacity plans will not carry over.

How do you audit dependencies for arm64 compatibility?

Start with lockfiles. Pure Python, JavaScript, Ruby or Go dependencies almost never break on arm64, so the real risk sits in the small set of packages that compile native code or download prebuilt binaries. Search package-lock.json, poetry.lock, Gemfile.lock and go.mod for node-gyp addons, Python packages without aarch64 wheels, gems with C extensions, and anything with "binary" or "prebuilt" in its install script. When no aarch64 wheel exists, the build falls back to compiling from source. That can fail outright or add minutes to every CI run. In Go, grep for import "C" and builds that set CGO_ENABLED=1. In C and C++ code, look for vendored libraries and x86 SIMD intrinsics such as immintrin.h. Code that uses them needs a NEON port or a scalar fallback.

Next, inventory everything in the image that you didn't write: security agents, APM sidecars, log shippers, database drivers and vendor CLIs. Confirm that each one has an arm64 build. Also compare release dates, because arm64 builds sometimes trail amd64. A lag forces you to choose between running an older agent on arm64 or keeping a split fleet.

Run the full test suite on arm64 hardware, not just a smoke test. After the build, run file on every executable and shared object in the final image. This catches x86-64 ELF binaries that were copied in by a curl step.

Finally, watch concurrency. x86 provides a stronger memory model, so a data race that never showed up there can become a real failure on arm64. Run race detectors and stress tests on arm64 specifically.

To estimate development cost, tag each dependency as green (works unchanged), yellow (needs a rebuild or an upgrade) or red (needs a port or a replacement). The red items make up most of your engineering estimate.

#!/usr/bin/env bash
set -euo pipefail
REPO="${1:-.}"
IMAGE="${2:-registry.example.com/myapp:arm64-candidate}"

echo '== Go packages using cgo (need a C toolchain and arm64 C libs)'
grep -rl --include='*.go' 'import "C"' "$REPO" || true

echo '== x86 SIMD intrinsics (need a NEON port or scalar fallback)'
grep -rlE --include='*.c' --include='*.cc' --include='*.cpp' --include='*.h' \
  '#include <(immintrin|emmintrin|xmmintrin|x86intrin)\.h>' "$REPO" || true

echo '== npm packages with install scripts (likely node-gyp or prebuilt binaries)'
[ -f "$REPO/package-lock.json" ] && grep -B8 '"hasInstallScript": true' \
  "$REPO/package-lock.json" | grep -oE '"node_modules/[^"]+"' || true

echo '== Python deps with no aarch64 wheel (these fall back to source builds)'
if [ -f "$REPO/requirements.txt" ]; then
  pip download --only-binary=:all: --platform manylinux2014_aarch64 \
    --python-version 3.12 -r "$REPO/requirements.txt" -d "$(mktemp -d)" \
    || echo 'At least one package has no aarch64 wheel; see error above'
fi

echo '== x86-64 binaries inside the final arm64 image (agents, curl-installed CLIs)'
WORK="$(mktemp -d)"
CID="$(docker create --platform linux/arm64 "$IMAGE")"
docker export "$CID" | tar -x -C "$WORK" 2>/dev/null || true
docker rm "$CID" >/dev/null
find "$WORK" -type f \( -perm -u+x -o -name '*.so*' \) -exec file {} + \
  | grep 'x86-64' || echo 'No x86-64 ELF files found'

echo '== Race detector under repetition (weaker memory model exposes latent races)'
[ -f "$REPO/go.mod" ] && (cd "$REPO" && go test -race -count=10 ./...)

A shell audit that flags cgo, x86 SIMD intrinsics, npm install scripts and missing aarch64 Python wheels in a repo. It then unpacks the built arm64 image, runs file to find stray x86-64 binaries, and runs Go's race detector on the arm64 host.

How do you build multi-arch images with docker buildx?

Once the dependency list is mostly green, the build itself becomes the next constraint. docker buildx build with --platform linux/amd64,linux/arm64 and --push builds one image per architecture and publishes a manifest list under a single tag. The container runtime pulls the variant that matches the node, so deployment manifests, Helm values and task definitions keep the same image reference. That is the main engineering-time saving: one tag, one pipeline, one promotion flow, instead of parallel -arm64 tags that drift apart.

Before the first build, run docker buildx imagetools inspect against every base image in the chain, including builder stages, distroless runtimes and internal golden images. A single amd64-only stage breaks the arm64 build, or quietly produces an image built for the wrong architecture.

You can build arm64 in two ways:

QEMU emulation Native arm64 runners
Setup Register binfmt handlers on existing x86 runners Provision and maintain a separate runner pool
Compile-heavy builds Slow, often several times slower Close to native x86 speed
Fidelity Can hide timing, concurrency and performance issues Matches production behaviour
Best for Interpreted languages, small images Compiled services, C extensions

Emulation is fine for producing artifacts. Final validation and load tests still have to run on real Graviton instances.

Supporting both architectures roughly doubles the build matrix, so CI time or runner spend goes up. Keep test suites per-architecture only where behaviour can actually differ. Developers on ARM laptops and x86 laptops can then pull the same tag and get a native image. When someone has to reproduce a production issue on the other architecture, pass --platform explicitly so the mismatch is a deliberate choice.

#!/usr/bin/env bash
set -euo pipefail

IMAGE="registry.example.com/payments/api"
TAG="1.4.2"

for base in golang:1.22-bookworm gcr.io/distroless/static-debian12 registry.example.com/base/golden:2024.10; do
  if docker buildx imagetools inspect "$base" | grep -q 'linux/arm64'; then
    echo "ok      $base"
  else
    echo "MISSING $base has no linux/arm64 variant" >&2
    exit 1
  fi
done

docker run --privileged --rm tonistiigi/binfmt --install arm64

docker buildx create --name multiarch --use --bootstrap

docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t "$IMAGE:$TAG" \
  --push .

docker buildx imagetools inspect "$IMAGE:$TAG"

docker run --rm --platform linux/amd64 "$IMAGE:$TAG" uname -m
docker run --rm --platform linux/arm64 "$IMAGE:$TAG" uname -m

A CI script that checks base images for arm64 variants, builds amd64 and arm64 images with docker buildx, publishes them under one tag as a manifest list, and pins --platform when you need to reproduce an issue on the other architecture.

How do you roll out Graviton incrementally on Kubernetes and ECS?

Start by adding arm64 capacity next to the existing x86 capacity instead of replacing it. On Kubernetes, that means a second node group. Every node carries the standard kubernetes.io/arch label, so you can pin pods with a node selector or node affinity. Taint the new arm64 nodes so that only workloads which explicitly tolerate the taint land there. Otherwise, any image that is still single-arch will be scheduled onto arm64 and fail to start.

On ECS, set the CPU architecture in the task definition's runtime platform. Run the arm64 tasks as a separate service with its own capacity provider.

For the canary, run both variants behind the same load balancer or Service. Keep the arm64 share small at first, controlled by replica ratio or target group weights. Compare p50 and p99 latency, error rate, and CPU utilization at equal request rates. Move more traffic only when the numbers hold across a full daily peak.

After the move, re-tune settings that were calibrated for x86:

  • Autoscaling thresholds. A Graviton vCPU is a physical core, while an x86 vCPU is usually a hyperthread. The same CPU percentage therefore represents different headroom, so a 70% HPA target may scale too early or too late.
  • Runtime flags. Remove JVM or runtime options copied from x86 tuning guides, and re-validate the defaults on arm64.
  • Worker counts. Thread pools and worker processes sized as "2 × vCPU" assumed hyperthreading. Re-measure them on arm64.

Finally, add architecture as a label on metrics, logs, and traces. During the mixed period, "only fails on some pods" often turns out to mean "only fails on arm64."

apiVersion: apps/v1
kind: Deployment
metadata:
  name: checkout-arm64
spec:
  replicas: 1
  selector:
    matchLabels:
      app: checkout
      arch: arm64
  template:
    metadata:
      labels:
        app: checkout      # matched by the shared Service
        arch: arm64        # lets dashboards and alerts split by architecture
    spec:
      # Pin to arm64 nodes using the standard, kubelet-set label.
      nodeSelector:
        kubernetes.io/arch: arm64
      # The arm64 node group is tainted (e.g. arch=arm64:NoSchedule), so only
      # workloads that opt in with this toleration can land there.
      tolerations:
        - key: arch
          operator: Equal
          value: arm64
          effect: NoSchedule
      containers:
        - name: checkout
          # Must be a multi-arch image (or an arm64 tag), or the pod will fail to start.
          image: registry.example.com/checkout:1.42.0
          resources:
            requests:
              cpu: "1"
              memory: 1Gi

An arm64 canary Deployment that uses a node selector and a toleration to land on tainted Graviton nodes, shares the x86 Service so the replica ratio sets its traffic share, and carries an arch label for per-architecture observability.

Does the migration pay back, and what are the alternatives?

Payback is the one-time migration cost divided by the monthly steady-state savings. The one-time cost covers engineering time, CI changes, extra testing, and the period when you pay for both architectures at once.

Illustrative estimate (all inputs assumed): Suppose the migration takes 120 engineering hours at $100/hour, and CI work plus the dual-architecture overlap add $3,000. That is $15,000 of one-time cost. Now assume a 15% lower cost per unit of work on arm64.

  • A $20,000/month fleet saves $3,000/month and pays back in 5 months.
  • A $2,000/month fleet saves $300/month and needs 50 months. By then the code, the instance types, and the prices will likely have changed.

The one-time cost barely shrinks with fleet size, so small fleets often never break even.

Alternative Effort Why it can beat migrating
Rightsizing on current architecture Low Overprovisioned instances often waste more than any architecture gap
Consolidating services Medium Fewer, fuller nodes cut idle capacity
Newer x86 generation Low Better price-performance with no change to dependencies
Savings Plans / Reserved Instances Very low A billing change only, no code work
Spot Medium Large discounts for interruption-tolerant workloads
Graviton for managed services only Low The provider handles compatibility, so you skip image and CI work

Choose the scope with the best return on engineering time. Start with commitments and rightsizing. Then migrate your largest stateless fleets, where payback is fastest. Leave small or dependency-heavy services alone.

EC2 pricing, regional capacity, and Spot availability all change over time. Recompute cost per unit of work periodically, and redo it before you renew any commitment, so you don't lock in an estimate that no longer holds.

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 vs x86 cost, 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.