Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Using ergon-tune

Run ergon-tune on the node and in the pod, before deploying and again with the application running. Fix every WARN, then rerun until none is left, and gate CI or start-up with --require. Every command, flag and exit code below is the ergon-tune binary’s own (tune/src/bin/ergon-tune.rs); the check catalogue is in Host checks.

When to run

whenwherewhy
before deployingon the nodethe boot line and NIC settings (T1, T2, N1) live on the node
at every pod’s start-upinside the podK1–K7 read the pod’s own cgroup and capabilities
with the application runningnode and podname the CPUs your pinned threads use with --hot; T9’s throttling counters grow only under load, and T15’s task scan sees who runs on the hot CPUs when you check
after every reboot or new imageon the noderuntime fixes (sysctl -w, echo into /sys, ethtool) are gone; the checks cannot tell which settings persist
after every NIC reseton the nodeENA re-places each queue’s IRQ (T2) and turns adaptive moderation back on (N1)

Commands

cargo install ergon-tune

ergon-tune --hot 2-7 --nic ens6 --tcp                # on the node
ergon-tune --root /host --hot 2-7 --require          # a pod with the node's / at /host
ergon-tune --hot 2-7 --family c7i --busy-poll --all  # AWS c7i, busy-polling sockets, verbose
flagwhat it does
--hot CPUSthe busy-spinning CPUs (a list such as 2-7); default: the node’s isolated ones. Name them: without hot CPUs the per-CPU checks have nothing to check
--nic NAME or --nic PCIadds T2, T6 and T20 for that NIC; repeatable. A value with two colons and a dot is a PCI address (0000:00:06.0), else an interface name (ens6)
--family NAMEthe AWS instance family, c7i, c7a, c8g or c9g (size optional, c7i.2xlarge): adds T26, which checks the host’s CPU layout and the --hot map against it
--tcpthe app sends latency-sensitive TCP: T21 warns instead of informing. Under --root T21 is UNKNOWN: the tree’s /proc/sys/net need not be the application’s network namespace
--busy-pollsockets busy-poll: K5 asks for CAP_NET_ADMIN
--component io|md|rtwho runs on the hot CPUs, for T3’s severity (default md)
--root DIRcheck a tree mounted from the node (such as /host) instead of /
--allalso print the checks that passed
--requireexit 1 where ERGON_HOST_CHECKS=require would refuse a start
--help, -husage; exits 0

Kubernetes

  • In the pod the K checks run by themselves (they detect the pod). The pod sees its own cgroup and capabilities; each fix names whether it is in the pod spec or on the node.
  • The node’s checks from inside a pod: mount the node’s / read-only at /host and use --root /host. Name the node’s interface with --nic, not the pod’s.
  • Gate start-up: run the same command with --require in an init container or CI job. In your own code, read ERGON_HOST_CHECKS through HostCheckPolicy (off, on/warn, require): require refuses a WARN and an unknown of a check that must prove something about this pod or process; an unknown of a subsystem the node may lack is reported and allowed through.

Reading the output

Each line is a tagged finding; a summary: N warnings, N info, N unknown, N ok line ends the report.

tagmeaningwhat to do
okpassed, or does not apply herenothing; printed only with --all
inforeal but minorfix when convenient
WARNthe setting costs latencyfix it; --require refuses
UNKNOWNthe data could not be readnever a warning; see what it cannot see
exit codemeaning
0reported (also --help)
1--require and the report would refuse a start
2usage error: unknown flag, missing value, bad --component

Privileges

whatprivilege
running the checksnone: they read /sys and /proc, and NIC settings over unprivileged netlink
busy pollingthe application needs CAP_NET_ADMIN; --busy-poll makes K5 warn when it is missing
real-time threads, mlockallCAP_SYS_NICE, CAP_IPC_LOCK (K5, when a library caller declares them)
the fixesroot on the node; a pod cannot write /sys, so fixes are node settings or pod-spec settings

What it cannot see

blind spoteffect
a pod’s virtual interface (a veth has no device behind it)the NIC checks are UNKNOWN in a pod; run them on the node or through --root /host
a virtio NIC’s own interrupts (they belong to its parent PCI device)T2 is UNKNOWN
the node’s tasks from a pod’s own PID namespaceT15 is UNKNOWN
a time daemon outside the pod’s namespacesT11 is UNKNOWN (the kernel’s own clock state is still read)
BPF programs as an unprivileged readerT16 is UNKNOWN
anything but Linux (macOS)the checks that read /sys and /proc are UNKNOWN (“only Linux has them”); per-CPU checks pass only because there is no hot CPU to check

Worked sequence: run, fix, rerun

ergon-tune --hot 2-7 --nic ens6 --family c7i --tcp --busy-poll --all
  1. Read the WARN lines. Each carries the fix for this host, with its real CPU lists and IRQ numbers.
  2. Apply each fix (node or pod spec), then rerun the same command.
  3. Repeat until the summary shows no warnings. info and UNKNOWN may remain; read them.
  4. Put ergon-tune --hot <cpus> --require in CI or an init container, or ERGON_HOST_CHECKS=require in the application’s start-up.
  5. After every reboot, image change or NIC reset, run it again.