All Products
Search
Document Center

Elastic High Performance Computing:Improve cluster performance by disabling HT for compute nodes

Last Updated:Apr 01, 2026

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 typeHT behaviorAction required
Enterprise-level x86 compute-optimized ECS instancesCan 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 InstancesCannot be disabled directly at the hardware level.Use a software-level method described in this topic.
Super Computing Cluster (SCC) instancesHT 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

Important

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

When manually scaling out the cluster, configure the HT setting in the Quantity And Type of Instances to be Added section. For details, see Manually scale out an E-HPC cluster.

Disable HT when manually scale out.png

Auto scaling

When configuring auto scaling for the cluster, configure the HT setting in the Global Configurations section. For details, see Configure auto scaling.

Disable HT when in auto scaling.png

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.

Important

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_cpusChange vCPU status
Restart requiredYesNo
lscpu outputShows only active CPUsShows all CPUs, including offline ones
PersistenceSurvives restartsResets on restart
Software licensing riskLowSome licenses count all CPUs, including offline ones
Custom image noteDelete nr_cpus before creating a custom image, or other instance types may not recognize all physical coresNo special action needed

Setnr_cpus

nr_cpus is a Linux kernel parameter that limits the maximum number of CPUs the kernel activates. Valid values: 2–255. Set it to half the vCPU count of your instance type to disable one thread per physical core.

The following steps use an ecs.ebmc6me.16xlarge instance (64 vCPUs, CentOS 7) as an example.

  1. Connect to the ECS Bare Metal Instance.

  2. Confirm that HT is enabled:

    lscpu

    In the output, CPU(s) equals the full vCPU count of the instance type and Thread(s) per core is 2.

    Bare Metal CPU.png

  3. Edit the GRUB configuration file:

    vim /boot/grub2/grub.cfg

    Press i to enter edit mode. Add nr_cpus=32 to the kernel command line (half of 64 vCPUs). Press Esc, then type :wq to save and exit.

    裸金属CPU111..png

  4. Restart the instance.

  5. Verify the result:

    lscpu

    The expected output shows CPU(s): 32 and Thread(s) per core: 1, confirming HT is effectively disabled:

    CPU(s):              32
    Thread(s) per core:  1

    To verify vCPU distribution across physical cores:

    lscpu --extend

    The expected output shows 32 vCPUs distributed across 32 physical cores.

    Bare metal CPU1.png

    Bare metal CPU11.png

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/online

The following steps use an ecs.ebmc6me.16xlarge instance (64 vCPUs, CentOS 7) as an example.

  1. Connect to the ECS Bare Metal Instance.

  2. Confirm that HT is enabled:

    lscpu

    In the output, CPU(s) equals the full vCPU count and Thread(s) per core is 2.

    Bare Metal CPU.png

  3. Create a script to take the second thread on each physical core offline:

    vim test.sh

    Paste 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
    done
  4. Run the script:

    sh test.sh
  5. Verify the result:

    lscpu

    The 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 --extend

    The expected output shows 32 online vCPUs distributed across 32 physical cores.

    Bare metal CPU22.png

    Bare metal CPU2.png