AWS hosts, x86 and Graviton
How to apply each node setting on a VM or a Kubernetes node. Which settings have evidence: Kubernetes HFT tuning.
Terms: deployment glossary.
Instances
Graviton first (c8g, c9g): no SMT, so one vCPU is one core. Any x86 is
acceptable, c7a over c7i. Pick the smallest size with the cores the test
needs; use Spot for tests.
| platform | instance types | notes |
|---|---|---|
| AWS Graviton | c8g.xlarge, c8g.2xlarge (Graviton4), c9g.xlarge, c9g.2xlarge (Graviton5) | no SMT: a vCPU is a core |
| AWS x86 | c7a (AMD, no SMT), c7i.xlarge, c7i.2xlarge, c7i.4xlarge, c7i.metal-24xl | a c7i.4xlarge has 8 cores with SMT off |
- Put both hosts in one cluster placement group. Not measured here.
- Compare only within one run and one host pair: two pairs of one instance type can differ.
Kernel command line
Keep the scheduler, the timer tick, RCU callbacks and new interrupts off
every CPU but housekeeping. <busy> is the busy CPUs, <hk> housekeeping:
isolcpus=managed_irq,domain,<busy> nohz_full=<busy> rcu_nocbs=<busy> irqaffinity=<hk>
Effect: settings. Kernel reference: kernel-parameters, NO_HZ. On x86 isolate whole cores (SMT off, so one CPU is one core).
| platform | also add | why |
|---|---|---|
| AWS x86, bare metal | iommu=pt | for a kernel-bypass driver that does not program the IOMMU; a VM has none |
| AWS Graviton, bare metal | iommu.passthrough=1 | the same, on Arm |
| EKS latency node (x86) | nosmt transparent_hugepage=never hugepagesz=2M hugepages=<n>; no C-state cap | Kubernetes nodes. No cap: C-states |
At every boot, kernel 6.12 and later: 0 into
/sys/kernel/debug/sched/fair_server/cpu<N>/runtime for each isolated N,
after debugfs is mounted (it is not persistent). The fair server’s 1 s
timer otherwise sends each isolated CPU a nohz kick and a reschedule IPI
and keeps its tick on (traced).
Only where nothing real-time runs on those CPUs.
clocksource=tsc tsc=reliable turns the kernel’s TSC checks off: bare
metal only, after measuring the TSC against a PTP/PHC reference, never on a
VM.
Interrupts and the NIC
Interrupt moderation means the NIC waits to batch several packets into one interrupt: less CPU, more latency (ENA driver).
| setting | how | evidence |
|---|---|---|
every movable interrupt on housekeeping, irqbalance stopped | /proc/irq/*/smp_affinity_list, /proc/irq/default_smp_affinity; systemctl disable --now irqbalance | not measured here |
| NIC queue interrupts pinned again after every NIC reset | ENA puts each queue’s interrupt back on CPU i when the interface comes up (reset, ethtool -G/-L, a NIC handed back by a kernel-bypass driver). Re-pin on each link event | as above |
| ENA moderation off | ethtool -C <if> adaptive-rx off rx-usecs 0; ENA turns adaptive moderation back on when the interface comes up, so re-apply it with the pins | not measured here |
| receive ring | ethtool -G <if> rx 4096 | not measured here |
| global busy polling | net.core.busy_read, busy_poll | it reaches every socket read on the host: leave unset and busy-poll per socket (SO_BUSY_POLL). Aeron’s media driver: hft |
C-states
A C-state is how deeply an idle CPU sleeps: deeper saves power but wakes later. A spinning core never idles; the housekeeping core that takes the interrupts does.
| host | setting | evidence |
|---|---|---|
| x86 VM | cap only the IRQ CPU (ergon-tune T20) | not measured here |
| x86 metal | cap only the IRQ CPU (ergon-tune T20) | not measured here |
| Graviton | nothing to set | the OS has no C-states to pick: an idle core waits for an interrupt (WFI) |
Memory
| setting | how | evidence |
|---|---|---|
| transparent hugepages off | transparent_hugepage=never on the boot line, or never into /sys/kernel/mm/transparent_hugepage/enabled | transhuge; traced: khugepaged ran a kworker on an isolated CPU (nri-shared-cpus) |
| 2 MiB hugepage pool | hugepagesz=2M hugepages=<n> on the boot line, or vm.nr_hugepages | Aeron’s hugetlbfs (and any kernel-bypass driver) draws from it |
| Aeron’s directory on a sized hugetlbfs | mount -t hugetlbfs -o pagesize=2M,size=1G nodev /mnt/huge-aeron; on the media driver AERON_FILE_PAGE_SIZE=2097152, AERON_TERM_BUFFER_SPARSE_FILE=false | without size= Aeron sees no free space and refuses every log buffer (hft) |
net.core.rmem_max, wmem_max | 16 MiB | needed only when Aeron’s socket buffers are raised above the kernel’s limit (hft) |
| automatic NUMA balancing off | sysctl -w kernel.numa_balancing=0 | not measured here (one-node lab hosts) |
Time
chrony on the Amazon Time Sync Service (169.254.169.123), or on the ENA’s
PTP clock. Configuration:
time sync.
CPU layout
One physical core per role. SMT is off on x86 latency nodes (SMT off), so one CPU is one core:
| core | x86 (SMT off) | Graviton (no SMT) |
|---|---|---|
| housekeeping: interrupts, Aeron’s conductor, client conductors | CPU 0 | CPU 0 |
| application, busy-spinning | one CPU | one CPU |
| media driver sender | one CPU | one CPU |
| media driver receiver | one CPU | one CPU |
io_uringSQPOLL: its kernel thread spins, so give it a CPU of the pod’s own, not the loop’s SMT sibling (not measured here).- Name one CPU per core.
thread_siblings_liststill lists the offline twin; use the lowest id of each core. AWS numbers x86 siblings N and N + cores.
Build for the CPU
- x86: rusteron builds Aeron’s C with
-march=nativeunlessRUSTERON_C_MARCHnames another, so build the media driver on, or for, the instance type it runs on. For an image that runs on several types, name a baseline such asx86-64-v2(armv8.2-aon Graviton), never the build host’s CPU. - Graviton: Rust with
RUSTFLAGS=-Ctarget-cpu=neoverse-v2(Graviton4),neoverse-v3(Graviton5) ornative; C withCFLAGS=-mcpu=.... Without it, Ubuntu’s and Debian’s gcc call a library helper for each atomic (gcc’s-moutline-atomicsdefault on AArch64). On AArch64-marchsets only the architecture;-mcpusets the core. Latency effect not measured here.
Check it
ergon-tune runs these checks, at start-up or as the
ergon-tune command on the node, and prints each finding with its fix.