Some HPC workloads—particularly those sensitive to memory bandwidth or CPU cache contention—perform better when Hyper-Threading (HT) is disabled, reducing the active vCPU count to match the physical core count. This topic describes how to disable HT on compute nodes in an E-HPC cluster.
Limitations
Check which method applies to your instance type before proceeding:
| Instance type | HT behavior | Action required |
|---|---|---|
| Enterprise-level x86 compute-optimized ECS instances | Can be disabled only at instance creation time. Cannot be changed after the instance is created. | Configure HT when adding nodes to the cluster. |
| ECS Bare Metal Instances | Cannot be disabled directly at the hardware level. | Use a software-level method described in this topic. |
| Super Computing Cluster (SCC) instances | HT is disabled by default. | No action required. |
For the full list of enterprise-level x86 instance types that support disabling HT, see Instance type limits.
Background
Each compute node in an E-HPC cluster runs as an Elastic Compute Service (ECS) instance. By default, HT is enabled on every ECS instance. HT creates two virtual processing cores (vCPUs) per physical core, letting two threads run concurrently on a single core. Disabling HT reduces the vCPU count to match the physical core count.
Disable HT on enterprise-level x86 compute-optimized ECS instances
HT cannot be disabled on enterprise-level x86 compute-optimized ECS instances after they are created. Configure the HT setting when adding compute nodes to the cluster.
Manual scale-out
Auto scaling
Disable HT on ECS Bare Metal Instances
Physically disabling HT on bare metal servers requires BIOS configuration and a hardware restart, which is complex and disruptive. Instead, use one of the following software-level methods to achieve the same effect within the guest operating system.
These methods may affect running workloads. Evaluate the impact in a test environment before applying them in production.
Each physical core maps to two vCPUs. Both methods work by deactivating one vCPU per physical core, leaving one active vCPU per physical core—the same effective result as disabling HT at the hardware level.
Choose a method
Set nr_cpus | Change vCPU status | |
|---|---|---|
| Restart required | Yes | No |
lscpu output | Shows only active CPUs | Shows all CPUs, including offline ones |
| Persistence | Survives restarts | Resets on restart |
| Software licensing risk | Low | Some licenses count all CPUs, including offline ones |
| Custom image note | Delete nr_cpus before creating a custom image, or other instance types may not recognize all physical cores | No special action needed |
Setnr_cpus
Change vCPU status
This method takes vCPUs offline at runtime without restarting the instance. The settings reset if the instance is restarted. To restore all vCPUs, run the following command for each offline vCPU:
echo 1 > /sys/devices/system/cpu/cpu$cpunum/onlineThe following steps use an ecs.ebmc6me.16xlarge instance (64 vCPUs, CentOS 7) as an example.
Confirm that HT is enabled:
lscpuIn the output,
CPU(s)equals the full vCPU count andThread(s) per coreis2.
Create a script to take the second thread on each physical core offline:
vim test.shPaste the following content:
#!/bin/bash for cpunum in $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | cut -s -d, -f2- | tr ',' '\n' | sort -un) do echo 0 > /sys/devices/system/cpu/cpu$cpunum/online doneRun the script:
sh test.shVerify the result:
lscpuThe expected output shows 32 vCPUs offline and
Thread(s) per core: 1. The response indicates that HT is disabled for the instance. To verify vCPU distribution across physical cores:lscpu --extendThe expected output shows 32 online vCPUs distributed across 32 physical cores.






