Goal
You see high tail latency, uneven core use or poor scaling past one socket on an OCI bare metal host. Before you resize, check whether threads, memory and devices are on the same NUMA node, and whether the BIOS profile suits the workload.
Warning
OCI advanced BIOS settings can't be changed after the instance is created. A different value means launching a replacement. Local NVMe data does not move with it.
1. Baseline the current host
- Record the shape, image, kernel and BIOS profile:
oci compute instance get --instance-id "$INSTANCE" \
--query 'data.{shape:shape,platform:"platform-config",image:"image-id",fd:"fault-domain"}'
uname -r
lscpu | grep -E 'Model name|Socket|Core|Thread|NUMA'
- Show node sizes and distances:
sudo dnf install -y numactl sysstat
numactl --hardware
cat /sys/devices/system/cpu/smt/active
- Check where the process memory is:
PID=$(pgrep -o -x postgres)
numastat -p "$PID"
grep -E 'Cpus_allowed_list|Mems_allowed_list' /proc/$PID/status
- Sample global locality twice under load and compare the increase, because the counters are cumulative:
numastat; sleep 60; numastat
numa_miss and other_node growth shows non-local allocation. It isn't proof of a performance problem by itself, since an interleaved process also produces it. Correlate it with latency.
2. Check device locality
- Map NICs and NVMe controllers to NUMA nodes:
for n in /sys/class/net/*; do
[ -e "$n/device/numa_node" ] && echo "$(basename $n) node=$(cat $n/device/numa_node)"
done
for d in /sys/class/nvme/nvme*; do
echo "$(basename $d) node=$(cat $d/device/numa_node 2>/dev/null)"
done
-1 means that the platform doesn't report locality.
- Look at interrupt distribution while traffic is flowing:
grep -E 'CPU|nvme|mlx|bnxt' /proc/interrupts | head -40
mpstat -P ALL 5 3
systemctl is-active irqbalance
One core with high %soft while others are idle points to queue or IRQ placement. Changing NPS won't fix that.
3. Choose the BIOS profile
The available settings depend on the shape. Check the Console's advanced BIOS options or the launch API for yours.
| Setting | Documented choices | Consider it when |
|---|---|---|
| NUMA nodes per socket (AMD) | NPS0, NPS1 (default), NPS2, NPS4 | Workload can be partitioned by node |
| NUMA nodes per socket (Intel) | NPS1 (default), NPS2 | Sub-NUMA clustering helps locality |
| NUMA nodes per socket (Arm) | NPS1 (default), NPS2, NPS4 | Processes can be pinned per node |
| SMT | On or off | Compute-bound threads compete for a core |
| Cores enabled | 25, 50, 75 or 100 percent | More memory bandwidth or cache per active core |
| Virtualization instructions | On or off | You run a hypervisor |
| Access control service, IOMMU | On or off | You pass devices through with VFIO |
NPS trade-offs
NPS1 gives one large pool per socket. It is the safe choice for one large database instance.
NPS2/NPS4 give lower local latency and better isolated bandwidth to pinned processes. Each node has less memory and fewer channels, so an unpinned process can perform worse.
NPS0 presents one node across sockets and interleaves. It suits software that can't handle NUMA, at the cost of average latency.
Confirm that the largest process (heap, buffer pool or VM) fits in one node with headroom. If it doesn't, a higher NPS forces remote memory.
SMT and core percentage
- Test SMT off when per-core licensing, jitter or floating-point work dominates. Keep it on for I/O-heavy services with many runnable threads.
- Don't expect savings from disabled cores. OCI bills the full shape regardless.
Caution
Oracle states that disabling cores through advanced BIOS settings is not a valid way to determine or limit the Oracle licenses needed under BYOL. Check your licence terms before you rely on core count.
4. Launch a test host
- Generate the template from your CLI version rather than copying a field list:
oci compute instance launch --generate-param-json-input platform-config
- Create the profile. This example is for a shape that accepts
GENERIC_BM; older shapes use a processor-specifictype.
{
"type": "GENERIC_BM",
"numaNodesPerSocket": "NPS4",
"isSymmetricMultiThreadingEnabled": false,
"percentageOfCoresEnabled": 100
}
- Launch it in a test compartment:
oci compute instance launch \
--availability-domain "$AD" --compartment-id "$COMPARTMENT" \
--shape "$SHAPE" --image-id "$IMAGE" --subnet-id "$SUBNET" \
--display-name numa-test-nps4 \
--ssh-authorized-keys-file ~/.ssh/id_ed25519.pub \
--platform-config file://platform.json \
--wait-for-state RUNNING
An invalid-parameter error normally means the type or option isn't supported on that shape. Check host capacity separately, as bare metal can be scarce.
- Verify from the OS with
lscpuandnumactl --hardware. Don't accept the API response alone.
5. Benchmark in a controlled order
- Use the same image, kernel, data set and region for both hosts.
- Change one setting at a time. NPS and SMT together hide each other's effect.
- Run a memory test local and remote:
sudo dnf install -y sysbench # may need the EPEL repository
# Local
numactl --cpunodebind=0 --membind=0 \
sysbench memory --threads=8 --memory-block-size=1M --memory-total-size=200G run
# Remote: choose the node with the largest distance
numactl --cpunodebind=0 --membind=1 \
sysbench memory --threads=8 --memory-block-size=1M --memory-total-size=200G run
Small blocks mostly measure cache. Treat this as a check of relative locality, then decide with the application benchmark.
- Run the real workload at least three times and compare p50, p99, throughput and CPU. A median improvement with worse p99 is not a win for online services.
6. Place the workload
- Bind a service that fits one node with systemd:
# /etc/systemd/system/app@.service.d/numa.conf
[Service]
CPUAffinity=numa
NUMAPolicy=bind
NUMAMask=%i
Run one instance per node, such as app@0 and app@1. These options depend on the systemd version; check man systemd.exec on the host.
Warning
A strict
bindcan trigger the OOM killer while other nodes still have free memory. Usepreferred, or leave headroom, when memory use isn't bounded.
- For one process that spans all nodes, test interleaving:
numactl --interleave=all /opt/app/bin/server
- Check automatic balancing and reclaim:
sysctl kernel.numa_balancing vm.zone_reclaim_mode
grep . /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages
Keep vm.zone_reclaim_mode=0 for most databases and caches. Test turning off automatic balancing only if processes are already pinned. Check that huge pages aren't all on one node.
OKE workers
- Use custom cloud-init for guaranteed pods that need aligned CPU and devices:
#!/bin/bash
curl --fail -H "Authorization: Bearer Oracle" -L0 \
http://169.254.169.254/opc/v2/instance/metadata/oke_init_script | \
base64 --decode > /var/run/oke-init.sh
bash /var/run/oke-init.sh --kubelet-extra-args \
"--cpu-manager-policy=static --topology-manager-policy=single-numa-node --reserved-cpus=0-3"
Choose reserved CPUs from the node's actual layout and include SMT siblings. Pods need Guaranteed QoS with integer CPU requests. single-numa-node rejects pods that fit the host but not one node, which appears as a topology affinity error. Memory alignment needs the kubelet Memory Manager too.
7. Roll out
- Put the profile in the Terraform or instance configuration that builds production.
- Back up or replicate local NVMe data before replacing a host.
- Replace one fault domain at a time and keep an old host for rollback.
- Set capacity alarms for fewer logical CPUs if SMT is off.
Symptom map
| Symptom | Likely cause | Fix |
|---|---|---|
| Slower after NPS4 | Process is larger than a node or unpinned | Interleave or return to NPS1 |
| OOM with free memory | Strict memory binding | Relax policy or resize the process |
| One busy core under network load | IRQ or queue placement | Adjust IRQ/RSS affinity |
| Identical hosts differ | BIOS profiles differ | Compare platform-config |
| Passthrough fails | IOMMU, ACS or virtualization is disabled | Relaunch with the required settings |
Prevent it next time
- Record
platform-configin inventory and alert when members of a pool differ. - Re-run the benchmark for each new shape or kernel. NPS results don't transfer between CPU generations.
- Keep NPS1 and SMT on as the default, and require measured evidence for exceptions.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get