Help Center> Elastic Cloud Server> User Guide> Instances> Purchasing an ECS> Enabling or Disabling Hyper-Threading
Updated on 2024-06-21 GMT+08:00

Enabling or Disabling Hyper-Threading

Application Scenarios

When purchasing an x86 ECS, you can enable or disable hyper-threading by specifying CPU options. If you do not specify it, hyper-threading is enabled by default.

When you purchase x86 ECSs, you can determine whether to enable hyper-threading based on your service scenarios:
  • If you require CPU cores to concurrently process a large amount of information and background tasks, enabling hyper-threading can greatly improve computing performance.
  • If your applications are compute-intensive and the computing performance is better when hyper-threading is disabled, such as material computing, disable hyper-threading.

You can enable or disable hyper-threading when purchasing x86 ECSs or changing their flavors.

Background

The processors of x86 ECSs support hyper-threading, which enables two threads to run concurrently on each CPU core. Each thread is represented as a virtual CPU (vCPU) and a CPU core contains two vCPUs. A vCPU is a virtual logical core.

A flavor defines the number of logical cores. For details, see Viewing the Number of Logical Cores of an ECS.

Hyper-threading is enabled for most x86 ECSs by default. If hyper-threading is disabled during the x86 ECS creation or flavor change, the number of vCPUs queried from the x86 ECS is half of the number of vCPUs defined by the ECS flavor.

For example, for the c7.xlarge.2 flavor, hyper-threading is enabled by default. The number of vCPUs is 4, and a 4-core physical CPU contains 4 vCPUs (threads). If hyper-threading is disabled, the number of vCPUs of this ECS is 2, and a 4-core physical CPU contains 2 vCPUs (threads).

Notes and Constraints

  • After an x86 ECS is purchased, you cannot directly change its hyper-threading status. To do so, you can change its flavor to change the hyper-threading status.
  • Enabling or disabling hyper-threading is free of charge.
  • For details about the ECS flavors that support hyper-threading, see x86 ECS Specifications.

Enabling or Disabling Hyper-Threading (During ECS Purchase)

  1. Configure basic, network, and advanced settings for ECSs based on service requirements. For details, see Purchasing an ECS.

  2. Select Configure now to configure advanced options.
  3. Select Specify CPU options.
    Figure 1 Specifying CPU options
  4. Set Threads per core.
    This parameter is displayed when Specify CPU options is selected. You can select a parameter value from the drop-down list.
    • 1: one thread per core, which means hyper-threading is disabled.
    • 2 (default value): two threads per core, which means hyper-threading is enabled.
  5. Click Next: Confirm to confirm the settings and complete the ECS purchase.

Enabling or Disabling Hyper-Threading (During ECS Flavor Change)

  1. Log in to the management console.
  2. Click in the upper left corner and select your region and project.
  3. Click and choose Computing > Elastic Cloud Server.
  4. On the Elastic Cloud Server page, locate the row containing the target ECS and choose More > Modify Specifications in the Operation column.

    The Modify ECS Specifications page is displayed.

  5. Select a new ECS type and flavor.

    Before modifying the specifications, stop the ECS or select Authorize ECS auto-stop.

    Figure 2 Modifying ECS specifications
  6. Click Next.
  7. Confirm the settings, read and select the agreement, and then click Submit Application.

Viewing the Number of Logical Cores of an ECS

You can log in to an ECS and view the number of its logical cores.

  • For Linux ECSs:
    1. Log in to a Linux ECS.
    2. Run the following command to view the number of logical cores of the ECS:

      lscpu

      As shown in Figure 3, CPU(s) indicates the number of logical cores.

      Figure 3 Viewing the result
  • For Windows ECSs:
    1. Log in to a Windows ECS.
    2. Choose Control Panel > Device Manager and expand Processors to view the number of logical cores (threads) of the ECS.
      Figure 4 Viewing the result