すべてのプロダクト
Search
ドキュメントセンター

Elastic High Performance Computing:コンピューティングノードの HT 無効化によるクラスターパフォーマンスの向上

最終更新日:Aug 21, 2026

一部の HPC ワークロード (特にメモリ帯域幅や CPU キャッシュの競合の影響を受けやすいワークロード) は、ハイパースレッディング (HT) を無効にするとパフォーマンスが向上します。HT を無効にすると、アクティブな vCPU 数が物理コア数と一致するまで減少します。このトピックでは、E-HPC クラスターのコンピューティングノードで HT を無効にする方法について説明します。

制限事項

先に進む前に、お使いのインスタンスタイプにどの方法が適用されるかを確認してください:

インスタンスタイプHT の動作必要なアクション
エンタープライズレベルの x86 コンピューティング最適化 ECS インスタンスインスタンス作成時にのみ無効化できます。インスタンス作成後は変更できません。クラスターにノードを追加する際に HT を設定します。
ECS ベアメタルインスタンスハードウェアレベルで直接無効にすることはできません。このトピックで説明するソフトウェアレベルの方法を使用します。
Super Computing Cluster (SCC) インスタンスデフォルトで HT は無効になっています。アクションは不要です。

HT の無効化をサポートするエンタープライズレベルの x86 インスタンスタイプの全リストについては、「インスタンスタイプの制限」をご参照ください。

背景

E-HPC クラスター内の各コンピューティングノードは、Elastic Compute Service (ECS) インスタンスとして動作します。デフォルトでは、すべての ECS インスタンスで HT が有効になっています。HT は、物理コアごとに 2 つの仮想プロセッシングコア (vCPU) を作成し、単一のコアで 2 つのスレッドを同時に実行できるようにします。HT を無効にすると、vCPU 数が物理コア数と一致するまで減少します。

エンタープライズレベルの x86 コンピューティング最適化 ECS インスタンスでの HT の無効化

重要

エンタープライズレベルの x86 コンピューティング最適化 ECS インスタンスは、作成後に HT を無効にすることはできません。クラスターにコンピューティングノードを追加する際に HT 設定を構成してください。

手動スケールアウト

クラスターを手動でスケールアウトする場合、[追加するインスタンスの数量とタイプ] セクションで HT 設定を設定します。詳細については、「E-HPC クラスターを手動でスケールアウトする」をご参照ください。

[Scale Out Cluster] ダイアログボックスの [Create Node] タブで、ecs.c7.large などのノード仕様を選択し、タブの下部にある [Disable HT] ドロップダウンリストを使用して、ハイパースレッディングを無効にするかどうかを指定します。このタブの他の設定項目には、vSwitch ID、課金方法、イメージ、キュー、ホスト名プレフィックス、システムディスクなどがあります。設定が完了したら、[Buy Now] をクリックします。

自動スケーリング

クラスターのオートスケーリングを設定する場合、[グローバル設定] セクションで HT 設定を構成します。詳細については、「オートスケーリングを設定する」をご参照ください。

ECS ベアメタルインスタンスでの HT の無効化

ベアメタルサーバーで物理的に HT を無効にするには、BIOS の設定とハードウェアの再起動が必要であり、複雑で中断を伴います。代わりに、以下のいずれかのソフトウェアレベルの方法を使用して、ゲスト OS 内で同じ効果を実現します。

重要

これらの方法は、実行中のワークロードに影響を与える可能性があります。本番環境に適用する前に、テスト環境で影響を評価してください。

各物理コアは 2 つの vCPU に対応します。どちらの方法も、物理コアごとに 1 つの vCPU を非アクティブ化し、アクティブな vCPU を 1 つだけ残します。これは、ハードウェアレベルで HT を無効にするのと実質的に同じ結果になります。

方法の選択

nr_cpus の設定vCPU ステータスの変更
再起動が必要はいいいえ
lscpu の出力アクティブな CPU のみ表示オフラインのものを含むすべての CPU を表示
永続性再起動後も維持される再起動時にリセットされる
ソフトウェアライセンスのリスク低い一部のライセンスでは、オフラインの CPU もすべてカウントされることがあります。
カスタムイメージに関する注意カスタムイメージを作成する前に nr_cpus を削除しないと、他のインスタンスタイプがすべての物理コアを認識しない場合があります特別なアクションは不要

nr_cpus の設定

nr_cpus は、カーネルが有効にする CPU の最大数を制限する Linux カーネルパラメーターです。有効な値: 2–255。物理コアあたり 1 つのスレッドを無効にするには、インスタンスタイプの vCPU 数の半分に設定します。

以下の手順では、ecs.ebmc6me.16xlarge インスタンス (64 vCPU、CentOS 7) を例に説明します。

  1. ECS ベアメタルインスタンスに接続します。

  2. HT が有効になっていることを確認します:

    lscpu

    出力では、CPU(s) はインスタンスタイプの vCPU の総数で、Thread(s) per core2 です。

    ~]# 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. インスタンスを再起動します。

  5. 結果を確認します:

    lscpu

    期待される出力では CPU(s): 32Thread(s) per core: 1 が表示され、HT が効果的に無効になっていることを確認できます。

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

    物理コア全体での vCPU の分布を確認するには:

    lscpu --extend

    期待される出力は、32 個の物理コアに分散された 32 個の vCPU を示します。

    [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

vCPU ステータスの変更

この方法は、インスタンスを再起動せずに、ランタイムに vCPU をオフラインにします。インスタンスが再起動されると、設定はリセットされます。すべての vCPU を復元するには、オフラインの各 vCPU に対して次のコマンドを実行します:

echo 1 > /sys/devices/system/cpu/cpu$cpunum/online

以下の手順では、ecs.ebmc6me.16xlarge インスタンス (64 vCPU、CentOS 7) を例に説明します。

  1. ECS ベアメタルインスタンスに接続します。

  2. HT が有効になっていることを確認します:

    lscpu

    出力では、CPU(s) は vCPU の総数であり、Thread(s) per core2 です。

    ~]# 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. 各物理コアの 2 番目のスレッドをオフラインにするスクリプトを作成します:

    vim test.sh

    次の内容を貼り付けます:

    #!/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. スクリプトを実行します:

    sh test.sh
  5. 結果を確認します:

    lscpu

    期待される出力では、32 個の vCPU がオフラインであり、Thread(s) per core: 1 と表示されます。この応答は、インスタンスで HT が無効になっていることを示しています。物理コア全体での vCPU の分布を確認するには、

    lscpu --extend

    期待される出力は、32 個の物理コアに分散された 32 個のオンライン vCPU を示します。

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