Measuring the Performance of t9g.medium and t4g.medium with Next.js Builds, OpenSSL, and dd

Measuring the Performance of t9g.medium and t4g.medium with Next.js Builds, OpenSSL, and dd

I benchmarked Next.js builds, OpenSSL, and dd on Amazon EC2 t9g.medium and t4g.medium. Median build time was 12.2s on t9g.medium versus 34.9s on t4g.medium. CPU info and CloudWatch burst metrics are also covered.
2026.11.20

This page has been translated by machine translation. View original

Introduction

On November 20, 2026, it was reported that the T9g, powered by Graviton5, had been listed on the EC2 On-Demand pricing page and in the API.

https://dev.classmethod.jp/articles/update-amazon-ec2-graviton5-t9g-instance/

For the T8i instance released in September 2026, we compared its performance with T3 in the following article.

https://dev.classmethod.jp/articles/ec2-t8i-vs-t3-medium-performance/

This time, we run t4g.medium and t9g.medium under the same conditions and compare the Next.js build, OpenSSL, and dd measurement results, CPU information, and CloudWatch burst-related metrics.

Test environment

  • Region: Tokyo (ap-northeast-1), ap-northeast-1a
  • Instances: t4g.medium, t9g.medium (both 2 vCPU)
  • AMI: Amazon Linux 2023.12.20261119
  • AMI SSM parameter: /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64 (version 205)
  • Kernel: 6.18.62-127.179.amzn2023.aarch64
  • Root volume: gp3 30 GiB, 3,000 IOPS, 125 MiB/s
  • Credit mode: unlimited
  • Detailed monitoring: enabled
  • Execution method: SSM Run Command (AWS-RunShellScript, root)
  • Node.js: v18.20.8
  • npm: 10.8.2
  • Next.js: 15.5.4
  • OpenSSL: 3.5.8

The On-Demand price in the Tokyo region for t9g.medium is about 1.24 times that of t4g.medium. Pricing details are in the previous article.

How the benchmarks were run

We ran the same three scripts as in the article comparing T8i and T3 medium (hereafter, the original article) on the two instances.

  • nextjs-bench.sh: Creates a project from the initial template of create-next-app@15.5.4. After running one warm-up build that is not measured, it measures the time taken by next build three times
  • openssl-bench.sh: Measures RSA2048, AES-256-GCM, and SHA-256 with openssl speed -multi 2 -seconds 5
  • dd-bench.sh: Writes 1GiB three times with conv=fdatasync oflag=direct to /var/tmp (xfs) on the root volume

The arm64 /proc/cpuinfo has no model name line, so grep fails and the script stops because of set -e. Therefore, in openssl-bench.sh I added || true to this grep. This one line (and its comment) is the only change from the script in the original article.

Full text of the three benchmark scripts

nextjs-bench.sh

#!/bin/bash
# Next.js production build time benchmark.
# Installs Node.js via dnf, creates a fixed create-next-app project,
# then measures `next build` wall-clock time over 3 clean runs.
set -e
export HOME=/root
echo "### install Node.js"
dnf install -y nodejs npm >/dev/null 2>&1
node -v
npm -v
echo
WORK=/root/nextbench
rm -rf "$WORK"
mkdir -p "$WORK"
cd "$WORK"
echo "### create-next-app (fixed version, non-interactive)"
# Pin Next.js version for reproducibility across both instances.
npx --yes create-next-app@15.5.4 app \
--ts --eslint --app --src-dir --no-tailwind --no-turbopack \
--import-alias "@/*" --use-npm >/tmp/cna.log 2>&1 || { echo "create-next-app FAILED"; tail -40 /tmp/cna.log; exit 1; }
cd app
echo "next version:"; node -e "console.log(require('next/package.json').version)"
echo
# Warm-up install already done by create-next-app. Do a warm-up build first (not measured).
echo "### warm-up build (not measured)"
npx next build >/tmp/warmup.log 2>&1 || { echo "warmup build FAILED"; tail -40 /tmp/warmup.log; exit 1; }
for i in 1 2 3; do
echo "===== next build run $i ====="
rm -rf .next
START=$(date +%s.%N)
npx next build >/tmp/build$i.log 2>&1 || { echo "build run $i FAILED"; tail -40 /tmp/build$i.log; exit 1; }
END=$(date +%s.%N)
echo "build_run_${i}_seconds: $(echo "$END - $START" | bc)"
done
echo "ALL BUILDS DONE"

openssl-bench.sh

#!/bin/bash
# OpenSSL benchmark: 3 representative workloads.
# Uses openssl speed with fixed measurement seconds so each run is ~short.
set -e
echo "### openssl version"
openssl version
echo
echo "### CPU model"
# The arm64 /proc/cpuinfo has no 'model name' line and the script stops because of set -e, so || true was added (the only change from the original article's script)
grep -m1 'model name' /proc/cpuinfo || true
# 1) RSA 2048 sign/verify (public-key, multi=2)
echo
echo "===== RSA2048 (multi=2) ====="
openssl speed -multi 2 -seconds 5 rsa2048 2>/dev/null
# 2) AES-256-GCM (symmetric cipher, AES-NI path)
echo
echo "===== AES-256-GCM (evp, multi=2) ====="
openssl speed -multi 2 -seconds 5 -evp aes-256-gcm 2>/dev/null
# 3) SHA-256 (hash)
echo
echo "===== SHA256 (evp, multi=2) ====="
openssl speed -multi 2 -seconds 5 -evp sha256 2>/dev/null

dd-bench.sh

#!/bin/bash
# dd 1GiB write benchmark. 3 runs, each syncs to disk (conv=fdatasync).
set -e
echo "### mount / fs of test dir"
df -T /var/tmp | tail -1
echo "### EBS volume from lsblk"
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
echo
for i in 1 2 3; do
echo "===== dd run $i : 1GiB (bs=1M count=1024) conv=fdatasync ====="
sync
dd if=/dev/zero of=/var/tmp/ddtest.bin bs=1M count=1024 conv=fdatasync oflag=direct 2>&1 || \
dd if=/dev/zero of=/var/tmp/ddtest.bin bs=1M count=1024 conv=fdatasync 2>&1
rm -f /var/tmp/ddtest.bin
echo
done

Measurement results

Next.js build

Instance Run 1 (s) Run 2 (s) Run 3 (s) Median (s)
t4g.medium 34.841 34.931 34.894 34.894
t9g.medium 12.116 12.155 12.275 12.155

For the build of the create-next-app initial template, judging by the median, t4g.medium took about 2.9 times as long as t9g.medium.

OpenSSL

Each value is the result of a single measurement. For AES-256-GCM and SHA-256, the k-suffixed values output by openssl speed (in units of 1,000 bytes/second) were divided by 1,000 and converted to MB/s.

Item Unit t4g.medium t9g.medium
RSA2048 sign ops/s 582.4 3,538.2
RSA2048 verify ops/s 21,314.2 139,028.0
AES-256-GCM (16-byte block) MB/s 108.18 204.89
AES-256-GCM (16 KiB block) MB/s 3,800.03 10,416.86
SHA-256 (16-byte block) MB/s 120.26 278.17
SHA-256 (16 KiB block) MB/s 3,063.26 4,141.26

The ratio of t9g.medium to t4g.medium was about 6.1x for RSA2048 signing and about 6.5x for verification. AES-256-GCM was about 1.9x at 16 bytes and about 2.7x at 16 KiB, and SHA-256 was about 2.3x at 16 bytes and about 1.4x at 16 KiB.

dd

Run t4g.medium time (s) t4g.medium (MB/s) t9g.medium time (s) t9g.medium (MB/s)
Run 1 7.18393 149 7.53108 143
Run 2 8.17437 131 8.18487 131
Run 3 8.18183 131 8.19217 131

The write speed in runs 2 and 3 was 131 MB/s on both instances, matching the 125 MiB/s (about 131 MB/s) configured for the volume.

CPU information

Commands used

We collected the same items as in the following two articles about c9g.

https://dev.classmethod.jp/articles/ec2-c9g-graviton5-instance-launch/

https://dev.classmethod.jp/articles/ec2-c9g-graviton5-tokyo-launch/

dnf install -y dmidecode hwloc
lscpu
dmidecode -t processor
lstopo-no-graphics
cat /proc/sys/abi/sve_default_vector_length

Comparison results

The c9g.medium column contains the values listed in the two articles above, not measurements from this test.

Item t4g.medium t9g.medium c9g.medium (value from the articles)
vCPU 2 2 1
lscpu BIOS Model name AWS Graviton2 AWS Graviton5 AWS Graviton5
lscpu Model name Neoverse-N1 No line No line
dmidecode Family ARMv8 ARMv9 ARMv9
dmidecode Part 0xd0c 0xd84 0xd84
lscpu Stepping r3p1 r0p1 r0p1
dmidecode Max Speed 2500 MHz 3300 MHz 3300 MHz
L2 cache (per core, lstopo) 1 MiB 2 MiB 2 MiB
lscpu L3 cache 32 MiB 48 MiB 48 MiB
SVE vector length (bytes) No file 16 16
Number of lscpu Flags 16 47 47

The 47 Flags of t9g.medium exactly matched the Flags in the two c9g articles. All 16 Flags of t4g.medium are also present on t9g.medium. The 31 present only on t9g.medium include sve, sve2, bf16, i8mm, sha3, and sha512.

CloudWatch metrics

For the two instances with detailed monitoring enabled, we retrieved the metrics after the benchmarks finished.

Metric types and granularity

We retrieved the list of metric names by specifying the InstanceId dimension in AWS/EC2.

aws cloudwatch list-metrics --region ap-northeast-1 --namespace AWS/EC2 \
  --dimensions Name=InstanceId,Value="$IID" \
  --query 'sort_by(Metrics,&MetricName)[].MetricName' --output json

The same 23 metrics were returned for both instances. The burst-related metrics are the following 8, and they are also output for t9g.medium.

  • CPU credits: CPUCreditUsage, CPUCreditBalance, CPUSurplusCreditBalance, CPUSurplusCreditsCharged
  • EBS burst balance: EBSIOBalance%, EBSByteBalance%
  • EBS excess checks: InstanceEBSIOPSExceededCheck, InstanceEBSThroughputExceededCheck

To retrieve the values, we used the following script, get-metrics.sh. It retrieves the burst-related metrics together with get-metric-statistics.

#!/bin/bash
# usage: get-metrics.sh INSTANCE_ID START END PERIOD
# Retrieve burst-related AWS/EC2 metrics with get-metric-statistics.
set -u
IID=$1
START=$2
END=$3
PERIOD=$4
for M in CPUUtilization CPUCreditUsage CPUCreditBalance CPUSurplusCreditBalance CPUSurplusCreditsCharged \
         'EBSIOBalance%' 'EBSByteBalance%' InstanceEBSIOPSExceededCheck InstanceEBSThroughputExceededCheck; do
  echo "=== $M (period=$PERIOD)"
  aws cloudwatch get-metric-statistics --region ap-northeast-1 --namespace AWS/EC2 \
    --metric-name "$M" --dimensions Name=InstanceId,Value="$IID" \
    --start-time "$START" --end-time "$END" --period "$PERIOD" \
    --statistics Average Minimum Maximum Sum \
    --query 'sort_by(Datapoints,&Timestamp)[].[Timestamp,Unit,Average,Minimum,Maximum,Sum]' --output text
done

The command we ran is as follows.

bash get-metrics.sh "$IID" 2026-11-20T08:04:00Z 2026-11-20T08:25:00Z 60

Even with detailed monitoring enabled and --period 60 specified, the CPU credit and EBS burst balance metrics returned only data points at 5-minute intervals. CPUUtilization and InstanceEBS*ExceededCheck are at 1-minute intervals.

CPU credits

All 5-minute data points for t4g.medium and t9g.medium are listed in chronological order (rounded to three decimal places).

t4g.medium

Time (JST) CPUCreditUsage CPUCreditBalance CPUSurplusCreditBalance
17:05 0.147 0.000 0.085
17:10 5.220 0.000 3.306
17:15 3.761 0.000 5.064
17:20 0.023 0.000 3.088

t9g.medium

Time (JST) CPUCreditUsage CPUCreditBalance CPUSurplusCreditBalance
17:05 0.436 0.000 0.051
17:10 1.588 0.360 0.000
17:15 3.682 0.000 1.322
17:20 No data No data No data

On both instances, which use the unlimited credit mode, CPUCreditBalance stayed near 0 while CPUSurplusCreditBalance increased. If you monitor only CPUCreditBalance, this behavior is not visible.

EBS and network

The minimum values of EBSIOBalance% and EBSByteBalance% were 99.0 on both instances. All data points for InstanceEBSIOPSExceededCheck and InstanceEBSThroughputExceededCheck were 0.0 on both instances. Within the scope of this benchmark, these metrics showed no values indicating EBS burst limits.

ENA statistics counters are not CloudWatch metrics, so we ran the following script, nic-stats.sh, inside the instance and retrieved them with ethtool.

#!/bin/bash
# Retrieve ENA statistics counters (including the allowance_exceeded family). The interface name is determined from the default route.
dnf install -y ethtool >/dev/null 2>&1
IF=$(ip -o route get 1.1.1.1 | awk '{for(i=1;i<=NF;i++) if($i=="dev") print $(i+1)}')
echo "interface: $IF"
ethtool -i "$IF" | grep -E '^(driver|version):'
ethtool -S "$IF"

These are cumulative values since boot, retrieved once after all the benchmarks had finished.

Counter t4g.medium (ens5) t9g.medium (ens34)
bw_in_allowance_exceeded 277 850
bw_out_allowance_exceeded 0 0
pps_allowance_exceeded 88 0
conntrack_allowance_exceeded 0 0
linklocal_allowance_exceeded 0 0

bw_in_allowance_exceeded, which indicates that the inbound bandwidth allowance was exceeded, was counted on both instances.

Summary

Comparing t9g.medium, which became available in the Tokyo region in November 2026, with t4g.medium under the same conditions, the median Next.js build time was about 2.9 times faster, and we confirmed a performance difference of up to about 6.5 times in OpenSSL.

The t9g price is about 1.24 times that of t4g, and the available sizes go up to medium. If you are using t4g.nano to medium and have workloads that could benefit from higher processing performance, please give it a try.

Share this article

AWSのお困り事はクラスメソッドへ

Related articles