Moving to Graviton4: What to Check, How to Measure, How to Migrate

On this page

Graviton4 has been generally available since July 2024, when the R8g instances launched; general-purpose M8g and compute-optimised C8g followed. AWS quotes up to 30 per cent better performance than Graviton3, with larger gains for some databases and Java services. In March 2026 the questions teams bring are less about whether Arm works and more about cost and risk: how much a move saves for a particular service, what will break, and how to move a cluster without a big-bang cutover.

This article covers what changes at the hardware level, how to compare prices fairly, the blockers that stop most migrations, and a staged path for containers on Amazon EKS or Amazon ECS. It does not publish benchmark percentages for Java, .NET or Python, because the result depends on the service, its dependencies and its load profile; it shows how to measure your own. The sample code runs the two checks that find most blockers before any node moves.

What is different about Graviton4

Graviton4 uses Arm Neoverse V2 cores, 96 per chip, with 2 MB of L2 cache per core and DDR5-5600 memory. Two details matter for capacity planning. First, a Graviton vCPU is a physical core; an Intel vCPU on M7i or C7i is a hyperthread, half of a core. A service that is CPU-bound and sized by vCPU count may need fewer Graviton vCPUs than x86 vCPUs, or it may not; only a test tells you. Second, Graviton instances have no simultaneous multithreading, so per-vCPU performance is more predictable under load, which tends to show up in tail latency rather than in average throughput.

Graviton5 was announced at re:Invent in December 2025, with up to 25 per cent better compute performance than Graviton4. As of March 2026 it is available only as M9g in preview, with compute- and memory-optimised variants planned for later in 2026. Anything you build for arm64 now runs on both.

Matrix comparing Graviton4 m8g, Intel m7i, AMD m7a and Graviton5 m9g on xlarge price, what a vCPU is, availability, software and fit
Graviton4 is cheaper per vCPU-hour and each vCPU is a whole core. The cost is an arm64 build of everything you run.

Comparing price fairly

On-demand list prices in us-east-1 put an m8g.xlarge at $0.1795 an hour against $0.2016 for an m7i.xlarge (11 per cent less) and about $0.232 for an m7a.xlarge. A c8g.4xlarge costs $0.638 against $0.714 for a c7i.4xlarge. Savings Plans and Reserved Instances apply to both architectures, so the gap is similar after discounts.

Those figures are price per instance, not cost per unit of work. The figure that decides a migration is cost per request (or per job) at your latency target: run the same load against an x86 and a Graviton4 deployment, raise it until p99 latency or error rate breaks your service level, and divide the instance cost by the throughput at that point. If Graviton4 sustains the same throughput on the same number of vCPUs, the saving is the price difference; if it sustains more, the saving is larger, because you can run fewer or smaller instances.

💡
MEASURE ON THE SAME TERMS

Use the same instance size, the same container image tag (built for both architectures), the same JVM or runtime flags and the same load profile. Warm up JIT runtimes before measuring. Compare p99 latency and errors as well as throughput, and run long enough to see garbage collection and autoscaling behaviour.

What breaks, and how to find it first

Migration path: check images and dependencies, build multi-architecture images, run a mixed node pool, measure, then shift; common blockers are amd64-only images, sdist-only packages, x86 native code in JARs and hard-coded x86_64 references
Most blockers are found before any node moves; the rest show up in the canary.

Interpreted and JIT-compiled code (Java, .NET, Node.js, Python) runs on arm64 without changes. Migrations stop on the things around it:

  • Images built only for amd64. Your own images need a multi-architecture build. Third-party images (monitoring agents, service mesh sidecars, log shippers, init containers) are the usual surprise; check the tag you actually run, not the project’s latest.
  • Python packages without aarch64 wheels. Most popular packages publish them, but a package with only a source distribution compiles during the image build and needs a compiler and headers in the build stage. psycopg2 is a common example; psycopg2-binary or psycopg 3 ship arm64 wheels.
  • Native code bundled in Java or .NET packages. JNI libraries and native NuGet assets built only for x86_64 fail at runtime, often on the first call to the feature that uses them.
  • Hard-coded architecture. Shell scripts that download x86_64 binaries, AMI filters, and build arguments that assume amd64.

The sample checks the first two automatically. check_images.py reads each image’s manifest from Amazon ECR and reports whether it includes linux/arm64, ignoring attestation entries in the index:

Python94 lines
"""Check whether container images in Amazon ECR can run on arm64 (Graviton).

An image runs on Graviton only if its manifest list (OCI image index) includes
a linux/arm64 entry. A single-platform manifest is checked through its config
blob's architecture. Pass repository:tag pairs; the report says which images
need a multi-architecture build before nodes can move.

Usage:
    python check_images.py orders-api:1.42.0 billing-worker:2026.03.1
"""
from __future__ import annotations

import json
import sys

import boto3
from botocore.exceptions import ClientError

INDEX_TYPES = {
    "application/vnd.oci.image.index.v1+json",
    "application/vnd.docker.distribution.manifest.list.v2+json",
}
ACCEPT = sorted(INDEX_TYPES | {
    "application/vnd.oci.image.manifest.v1+json",
    "application/vnd.docker.distribution.manifest.v2+json",
})


def platforms_of(ecr, repository: str, tag: str) -> set[str]:
    """Return the os/arch platforms an image tag provides, e.g. {'linux/amd64'}."""
    resp = ecr.batch_get_image(
        repositoryName=repository,
        imageIds=[{"imageTag": tag}],
        acceptedMediaTypes=ACCEPT,
    )
    if resp.get("failures"):
        f = resp["failures"][0]
        raise LookupError(f"{repository}:{tag}: {f['failureCode']} {f.get('failureReason', '')}".strip())
    image = resp["images"][0]
    manifest = json.loads(image["imageManifest"])
    media_type = image.get("imageManifestMediaType") or manifest.get("mediaType")

    if media_type in INDEX_TYPES:
        found = set()
        for m in manifest.get("manifests", []):
            p = m.get("platform") or {}
            # Attestation manifests (provenance, SBOM) are listed as unknown/unknown
            if p.get("os") and p.get("architecture") and p["architecture"] != "unknown":
                variant = f"/{p['variant']}" if p.get("variant") else ""
                found.add(f"{p['os']}/{p['architecture']}{variant}")
        return found

    # Single-platform image: the architecture is in the config blob
    digest = manifest["config"]["digest"]
    layer = ecr.get_download_url_for_layer(repositoryName=repository, layerDigest=digest)
    config = _fetch_json(layer["downloadUrl"])
    return {f"{config.get('os', 'linux')}/{config['architecture']}"}


def _fetch_json(url: str) -> dict:
    import urllib.request
    with urllib.request.urlopen(url, timeout=30) as resp:  # presigned S3 URL from ECR
        return json.loads(resp.read())


def arm64_ready(platforms: set[str]) -> bool:
    return any(p.startswith("linux/arm64") for p in platforms)


def report(ecr, refs: list[str]) -> list[dict]:
    rows = []
    for ref in refs:
        repository, _, tag = ref.rpartition(":")
        if not repository:
            raise ValueError(f"{ref}: expected repository:tag")
        try:
            plats = platforms_of(ecr, repository, tag)
            rows.append({"image": ref, "platforms": sorted(plats), "arm64": arm64_ready(plats)})
        except (LookupError, ClientError) as exc:
            rows.append({"image": ref, "platforms": [], "arm64": False, "error": str(exc)})
    return rows


def main(argv: list[str]) -> int:
    ecr = boto3.client("ecr")
    rows = report(ecr, argv)
    for r in rows:
        status = "ok" if r["arm64"] else ("ERROR " + r["error"] if "error" in r else "needs arm64 build")
        print(f"{r['image']:<45} {','.join(r['platforms']) or '-':<30} {status}")
    return 0 if all(r["arm64"] for r in rows) else 1


if __name__ == "__main__":
    sys.exit(main(sys.argv[1:]))

check_wheels.py reads pinned requirements and asks PyPI whether each release has a pure-Python or aarch64 wheel. Both scripts exit non-zero when something needs attention, so they can run in a pipeline before a migration ticket is even opened:

Python84 lines
"""Check pinned Python dependencies for Linux arm64 (aarch64) wheels on PyPI.

For each name==version line in a lock or requirements file, the PyPI JSON API
lists the files published for that release. A package is ready if it ships a
pure-Python wheel or a manylinux/musllinux aarch64 wheel. Packages with only
an sdist will compile during the image build, which needs a toolchain in the
build stage and is where arm64 builds usually fail.

Usage:
    python check_wheels.py requirements.txt
"""
from __future__ import annotations

import json
import re
import sys
import urllib.error
import urllib.request
from typing import Callable

PIN = re.compile(r"^\s*([A-Za-z0-9][A-Za-z0-9._-]*)(\[[^\]]*\])?\s*==\s*([^\s;#\\]+)")


def parse_pins(text: str) -> list[tuple[str, str]]:
    pins = []
    for line in text.splitlines():
        line = line.strip()
        if not line or line.startswith(("#", "-")):
            continue
        m = PIN.match(line)
        if m:
            pins.append((m.group(1), m.group(3)))
    return pins


def classify(filenames: list[str]) -> str:
    """'pure', 'aarch64', 'sdist-only', 'x86-only' or 'none'."""
    wheels = [f for f in filenames if f.endswith(".whl")]
    if any(f.endswith("-none-any.whl") for f in wheels):
        return "pure"
    if any(re.search(r"(manylinux|musllinux)[^-]*aarch64", f) for f in wheels):
        return "aarch64"
    if any(f.endswith((".tar.gz", ".zip")) for f in filenames):
        return "sdist-only"
    return "x86-only" if wheels else "none"


def pypi_files(name: str, version: str) -> list[str]:
    url = f"https://pypi.org/pypi/{name}/{version}/json"
    req = urllib.request.Request(url, headers={"Accept": "application/json"})
    with urllib.request.urlopen(req, timeout=30) as resp:
        data = json.loads(resp.read())
    return [u["filename"] for u in data.get("urls", [])]


def check(pins: list[tuple[str, str]],
          fetch: Callable[[str, str], list[str]] = pypi_files) -> list[dict]:
    rows = []
    for name, version in pins:
        try:
            status = classify(fetch(name, version))
        except urllib.error.HTTPError as exc:
            status = "not-on-pypi" if exc.code == 404 else f"http-{exc.code}"
        rows.append({"package": name, "version": version, "status": status})
    return rows


READY = {"pure", "aarch64"}


def main(argv: list[str]) -> int:
    if len(argv) != 1:
        print(__doc__)
        return 2
    with open(argv[0], encoding="utf-8") as fh:
        rows = check(parse_pins(fh.read()))
    for r in rows:
        mark = "ok" if r["status"] in READY else "CHECK"
        print(f"{r['package']:<30} {r['version']:<15} {r['status']:<12} {mark}")
    return 0 if all(r["status"] in READY for r in rows) else 1


if __name__ == "__main__":
    sys.exit(main(sys.argv[1:]))

Moving a cluster without a cutover

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#FFF3E0', 'primaryTextColor': '#232F3E', 'primaryBorderColor': '#FF9900', 'lineColor': '#232F3E', 'clusterBkg': '#F8FAFC', 'clusterBorder': '#CBD5E1', 'edgeLabelBackground': '#FFFFFF', 'nodeTextColor': '#232F3E'}}}%%
flowchart TD
    A["Readiness checks pass<br/>for the service"] --> B["Publish one image tag<br/>for amd64 and arm64"]
    B --> C["Node pool allows both<br/>architectures"]
    C --> D["Canary: a share of pods<br/>scheduled on arm64"]
    D --> E{"p99, errors and cost<br/>per request OK?"}
    E -- "No" --> F["Pin the service to amd64,<br/>investigate"]
    E -- "Yes" --> G["Prefer arm64 for the service,<br/>keep amd64 allowed"]
    G --> H["Remove amd64 when every<br/>service has moved"]
    classDef aws fill:#FFF3E0,stroke:#FF9900,stroke-width:2px,color:#232F3E
    classDef ok fill:#F0FFF4,stroke:#1D8102,stroke-width:2px,color:#145202
    classDef warn fill:#FEF2F2,stroke:#D13212,stroke-width:2px,color:#991B1B
    class A,B,C,D,E aws
    class G,H ok
    class F warn

Build once for both architectures. Publish a single tag whose manifest list contains amd64 and arm64 images. Native arm64 build runners (Graviton-based CodeBuild or self-hosted runners) are faster and more faithful than emulation; emulated builds through QEMU work but can be several times slower for compiled dependencies.

Let the scheduler choose. On EKS, a Karpenter NodePool whose requirements allow both kubernetes.io/arch values, or separate managed node groups, gives the scheduler both kinds of node. Workloads that are not ready get a node affinity or node selector for amd64; ready ones get a preference for arm64. On ECS, use separate capacity providers per architecture and set the task definition’s runtimePlatform.cpuArchitecture, or run two services behind the same target group during the canary.

Canary, measure, then shift. Move a share of replicas to arm64, compare the two populations on the same dashboards, and widen the share when latency, errors and cost per request hold. Because the image tag is the same and amd64 nodes remain allowed, rolling back is a scheduling change, not a rebuild.

⚠️
DO NOT FORGET DAEMONSETS AND ADD-ONS

A node only works if every DaemonSet and add-on on it has an arm64 image: CNI, CSI drivers, log and metrics agents, security tooling. Check them before adding the first arm64 node, or pods will sit in ImagePullBackOff on the new nodes while the old ones carry the load.

⚖️
KEEP SECURITY TOOLING IN SCOPE

Confirm that vulnerability scanners, runtime security agents and any FIPS-validated cryptographic modules you depend on support arm64 and are certified for it where your compliance regime requires. Scan both architecture images in the manifest list; they are separate artefacts with separate packages.

📝
HOW THIS WAS CHECKED

check_images.py and check_wheels.py were tested with Python 3.13, boto3==1.42.55 and pytest==9.0.2: thirteen tests cover OCI indexes, Docker manifest lists with attestation entries, single-platform images, missing tags, requirements parsing and wheel classification, with ECR calls validated by botocore’s Stubber against the ECR API model. check_wheels.py was also run against live PyPI for numpy 2.2.3, psycopg2 2.9.10, psycopg2-binary 2.9.10 and requests 2.32.3. No instance was benchmarked. Prices are us-east-1 Linux on-demand list prices.

Key takeaways

  • Graviton4 has been GA since July 2024; Graviton5 is in preview as M9g. arm64 builds made now run on both.
  • A Graviton vCPU is a whole core and costs about 10 per cent less per hour than an Intel vCPU, which is a hyperthread. Compare cost per request at your latency target.
  • Most blockers are outside your code: amd64-only images and agents, packages without arm64 wheels, x86 native libraries, hard-coded architectures.
  • Build one multi-architecture tag, let the scheduler use both kinds of node, canary on arm64, and shift when the numbers hold.
  • Check every DaemonSet, add-on and security tool for arm64 before the first node joins.

What stopped or slowed your move to Graviton, and how much did it save once it was done? Share it in the comments.

Glossary

Graviton4
AWS’s fourth-generation Arm-based server processor, used in M8g, C8g and R8g instances.
arm64 / aarch64
The 64-bit Arm architecture; the two names mean the same thing.
Manifest list (image index)
A container registry entry that points to one image per platform under a single tag.
Wheel
A pre-built Python package; platform wheels contain compiled code for one architecture.
sdist
A Python source distribution, compiled during installation if it contains native code.
SMT / hyperthreading
Running two hardware threads on one core; x86 vCPUs are threads, Graviton vCPUs are cores.
Karpenter NodePool
A Karpenter resource that defines which instance types and architectures nodes may use.

References & Further Reading


Discover more from C4: Container, Code, Cloud & Context

Subscribe to get the latest posts sent to your email.

Written by

Nithin Mohan TK

Hello Namaste! 👋🏻 I'm an accomplished Enterprise Solution Architect & Engineering Leader with 20+ years of progressive experience architecting, building, and scaling transformative enterprise solutions. ⚜️ Solution Architect / AI & Cloud 📌 Galway, Ireland

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.