All Products
Search
Document Center

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

Last Updated:Aug 21, 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.

On the Create Node tab of the Scale Out Cluster dialog box, select a node specification, such as ecs.c7.large, and then use the Disable HT drop-down list at the bottom of the tab to specify whether to disable hyper-threading. The other configuration items on this tab include the vSwitch ID, billing method, image, queue, hostname prefix, and system disk. After you complete the configuration, click Buy Now.

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 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.

    ~]# lscpu
    Architecture:          x86_64
    CPU op-mode(s):        32-bit, 64-bit
    Byte Order:            Little Endian
    CPU(s):                64
    On-line CPU(s) list:   0-63
    Thread(s) per core:    2
    Core(s) per socket:    16
    Socket(s):             2
    NUMA node(s):          2
    Vendor ID:             GenuineIntel
    CPU family:            6
    Model:                 85
    Model name:            Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz
    Stepping:              7
    CPU MHz:               2799.896
    CPU max MHz:           3900.0000
    CPU min MHz:           1000.0000
    BogoMIPS:              4600.00
    Virtualization:        VT-x
    L1d cache:             32K
    L1i cache:             32K
    L2 cache:              1024K
    L3 cache:              22528K
    NUMA node0 CPU(s):     0-15,32-47
    NUMA node1 CPU(s):     16-31,48-63
    Flags:                 fpu vme de pse tsc msr pae mce cx8 apic se
  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.

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.21.3.el7.x86_64-advanced-1114fe9e-2309-4580-b183-d778e6d97397' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  1114fe9e-2309-4580-b183-d778e6d97397
        else
          search --no-floppy --fs-uuid --set=root 1114fe9e-2309-4580-b183-d778e6d97397
        fi
        linux16 /boot/vmlinuz-3.10.0-957.21.3.el7.x86_64 root=UUID=1114fe9e-2309-4580-b183-d778e6d97397 ro crashkernel=auto    idle=halt biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8 noibrs nvme_core.admin_timeout=4294967295  nomodeset intel_idle.max_cstate=1 nr_cpus=32
        initrd16 /boot/initramfs-3.10.0-957.21.3.el7.x86_64.img
    }
    menuentry 'CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.el7.x86_64-advanced-1114fe9e-2309-4580-b183-d778e6d97397' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  1114fe9e-2309-4580-b183-d778e6d97397
        else
          search --no-floppy --fs-uuid --set=root 1114fe9e-2309-4580-b183-d778e6d97397
        fi
        linux16 /boot/vmlinuz-3.10.0-957.el7.x86_64 root=UUID=1114fe9e-2309-4580-b183-d778e6d97397 ro crashkernel=auto    idle=halt biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8 noibrs nvme_core.admin_timeout=4294967295  nomodeset intel_idle.max_cstate=1 nr_cpus=32
        initrd16 /boot/initramfs-3.10.0-957.el7.x86_64.img
    }
  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.

    [root@iZu            ~]# lscpu
    Architecture:          x86_64
    CPU op-mode(s):        32-bit, 64-bit
    Byte Order:            Little Endian
    CPU(s):                32
    On-line CPU(s) list:   0-31
    Thread(s) per core:    1
    Core(s) per socket:    16
    Socket(s):             2
    NUMA node(s):          2
    Vendor ID:             GenuineIntel
    CPU family:            6
    Model:                 85
    Model name:            Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz
    Stepping:              7
    CPU MHz:               2301.000
    CPU max MHz:           2301.0000
    CPU min MHz:           1000.0000
    BogoMIPS:              4600.00
    Virtualization:        VT-x
    L1d cache:             32K
    L1i cache:             32K
    L2 cache:              1024K
    L3 cache:              22528K
    NUMA node0 CPU(s):     0-15
    NUMA node1 CPU(s):     16-31
    Flags:                 fpu vme de pse tsc msr pae mce cx8 apic se
    nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds
    ~]# lscpu --extend
    CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ    MINMHZ
    0   0    0      0    0:0:0:0       yes    2301.0000 1000.0000
    1   0    0      1    1:1:1:0       yes    2301.0000 1000.0000
    2   0    0      2    2:2:2:0       yes    2301.0000 1000.0000
    3   0    0      3    3:3:3:0       yes    2301.0000 1000.0000
    4   0    0      4    4:4:4:0       yes    2301.0000 1000.0000
    5   0    0      5    5:5:5:0       yes    2301.0000 1000.0000
    6   0    0      6    6:6:6:0       yes    2301.0000 1000.0000
    7   0    0      7    7:7:7:0       yes    2301.0000 1000.0000
    8   0    0      8    8:8:8:0       yes    2301.0000 1000.0000
    9   0    0      9    9:9:9:0       yes    2301.0000 1000.0000
    10  0    0      10   10:10:10:0    yes    2301.0000 1000.0000
    11  0    0      11   11:11:11:0    yes    2301.0000 1000.0000
    12  0    0      12   12:12:12:0    yes    2301.0000 1000.0000
    13  0    0      13   13:13:13:0    yes    2301.0000 1000.0000
    14  0    0      14   14:14:14:0    yes    2301.0000 1000.0000
    15  0    0      15   15:15:15:0    yes    2301.0000 1000.0000
    16  1    1      16   16:16:16:1    yes    2301.0000 1000.0000
    17  1    1      17   17:17:17:1    yes    2301.0000 1000.0000
    18  1    1      18   18:18:18:1    yes    2301.0000 1000.0000
    19  1    1      19   19:19:19:1    yes    2301.0000 1000.0000
    20  1    1      20   20:20:20:1    yes    2301.0000 1000.0000
    21  1    1      21   21:21:21:1    yes    2301.0000 1000.0000
    22  1    1      22   22:22:22:1    yes    2301.0000 1000.0000
    23  1    1      23   23:23:23:1    yes    2301.0000 1000.0000
    24  1    1      24   24:24:24:1    yes    2301.0000 1000.0000
    25  1    1      25   25:25:25:1    yes    2301.0000 1000.0000
    26  1    1      26   26:26:26:1    yes    2301.0000 1000.0000
    27  1    1      27   27:27:27:1    yes    2301.0000 1000.0000
    28  1    1      28   28:28:28:1    yes    2301.0000 1000.0000
    29  1    1      29   29:29:29:1    yes    2301.0000 1000.0000
    30  1    1      30   30:30:30:1    yes    2301.0000 1000.0000
    31  1    1      31   31:31:31:1    yes    2301.0000 1000.0000

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.

    ~]# lscpu
    Architecture:          x86_64
    CPU op-mode(s):        32-bit, 64-bit
    Byte Order:            Little Endian
    CPU(s):                64
    On-line CPU(s) list:   0-63
    Thread(s) per core:    2
    Core(s) per socket:    16
    Socket(s):             2
    NUMA node(s):          2
    Vendor ID:             GenuineIntel
    CPU family:            6
    Model:                 85
    Model name:            Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz
    Stepping:              7
    CPU MHz:               2799.896
    CPU max MHz:           3900.0000
    CPU min MHz:           1000.0000
    BogoMIPS:              4600.00
    Virtualization:        VT-x
    L1d cache:             32K
    L1i cache:             32K
    L2 cache:              1024K
    L3 cache:              22528K
    NUMA node0 CPU(s):     0-15,32-47
    NUMA node1 CPU(s):     16-31,48-63
    Flags:                 fpu vme de pse tsc msr pae mce cx8 apic se
  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.

    # lscpu
    Architecture:        x86_64
    CPU op-mode(s):      32-bit, 64-bit
    Byte Order:          Little Endian
    CPU(s):              64
    On-line CPU(s) list: 0-31
    Off-line CPU(s) list: 32-63
    Thread(s) per core:  1
    Core(s) per socket:  16
    Socket(s):           2
    NUMA node(s):        2
    Vendor ID:           GenuineIntel
    CPU family:          6
    Model:               85
    Model name:          Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz
    Stepping:            7
    CPU MHz:             2800.036
    CPU max MHz:         3900.0000
    CPU min MHz:         1000.0000
    BogoMIPS:            4600.00
    Virtualization:      VT-x
    L1d cache:           32K
    L1i cache:           32K
    L2 cache:            1024K
    L3 cache:            22528K
    NUMA node0 CPU(s):   0-15
    NUMA node1 CPU(s):   16-31
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic s
    pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg f
    [root@iZuf6d2vgqoyhr~]# lscpu --extend
    CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ    MINMHZ
    0   0    0      0    0:0:0:0        yes    3900.0000 1000.0000
    1   0    0      1    1:1:1:0        yes    3900.0000 1000.0000
    2   0    0      2    2:2:2:0        yes    3900.0000 1000.0000
    3   0    0      3    3:3:3:0        yes    3900.0000 1000.0000
    4   0    0      4    4:4:4:0        yes    3900.0000 1000.0000
    5   0    0      5    5:5:5:0        yes    3900.0000 1000.0000
    6   0    0      6    6:6:6:0        yes    3900.0000 1000.0000
    7   0    0      7    7:7:7:0        yes    3900.0000 1000.0000
    8   0    0      8    8:8:8:0        yes    3900.0000 1000.0000
    9   0    0      9    9:9:9:0        yes    3900.0000 1000.0000
    10  0    0      10   10:10:10:0     yes    3900.0000 1000.0000
    11  0    0      11   11:11:11:0     yes    3900.0000 1000.0000
    12  0    0      12   12:12:12:0     yes    3900.0000 1000.0000
    13  0    0      13   13:13:13:0     yes    3900.0000 1000.0000
    14  0    0      14   14:14:14:0     yes    3900.0000 1000.0000
    15  0    0      15   15:15:15:0     yes    3900.0000 1000.0000
    16  1    1      16   16:16:16:1     yes    3900.0000 1000.0000
    17  1    1      17   17:17:17:1     yes    3900.0000 1000.0000
    18  1    1      18   18:18:18:1     yes    3900.0000 1000.0000
    19  1    1      19   19:19:19:1     yes    3900.0000 1000.0000
    20  1    1      20   20:20:20:1     yes    3900.0000 1000.0000
    21  1    1      21   21:21:21:1     yes    3900.0000 1000.0000
    22  1    1      22   22:22:22:1     yes    3900.0000 1000.0000
    23  1    1      23   23:23:23:1     yes    3900.0000 1000.0000
    24  1    1      24   24:24:24:1     yes    3900.0000 1000.0000
    25  1    1      25   25:25:25:1     yes    3900.0000 1000.0000
    26  1    1      26   26:26:26:1     yes    3900.0000 1000.0000
    27  1    1      27   27:27:27:1     yes    3900.0000 1000.0000
    28  1    1      28   28:28:28:1     yes    3900.0000 1000.0000
    29  1    1      29   29:29:29:1     yes    3900.0000 1000.0000
    30  1    1      30   30:30:30:1     yes    3900.0000 1000.0000
    31  1    1      31   31:31:31:1     yes    3900.0000 1000.0000
    32  -    -      -    :::            no     -         -
    33  -    -      -    :::            no     -         -
    34  -    -      -    :::            no     -         -
    35  -    -      -    :::            no     -         -
    36  -    -      -    :::            no     -         -
    37  -    -      -    :::            no     -         -
    38  -    -      -    :::            no     -         -
    39  -    -      -    :::            no     -         -
    40  -    -      -    :::            no     -         -
    41  -    -      -    :::            no     -         -
    42  -    -      -    :::            no     -         -
    43  -    -      -    :::            no     -         -
    44  -    -      -    :::            no     -         -
    45  -    -      -    :::            no     -         -
    46  -    -      -    :::            no     -         -
    47  -    -      -    :::            no     -         -
    48  -    -      -    :::            no     -         -
    49  -    -      -    :::            no     -         -
    50  -    -      -    :::            no     -         -
    51  -    -      -    :::            no     -         -
    52  -    -      -    :::            no     -         -
    53  -    -      -    :::            no     -         -
    54  -    -      -    :::            no     -         -
    55  -    -      -    :::            no     -         -
    56  -    -      -    :::            no     -         -
    57  -    -      -    :::            no     -         -
    58  -    -      -    :::            no     -         -
    59  -    -      -    :::            no     -         -
    60  -    -      -    :::            no     -         -
    61  -    -      -    :::            no     -         -
    62  -    -      -    :::            no     -         -
    63  -    -      -    :::            no     -         -