Enabling or Disabling Hyper-Threading
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.
- If you require CPU cores to concurrently process a large amount of data and background tasks, enabling hyper-threading can greatly improve computing performance.
- For compute-intensive or high-performance computing (HPC) applications, such as computational materials science, disabling hyper-threading is a better choice.
You can enable or disable hyper-threading when purchasing x86 ECSs or modifying their specifications.
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). A vCPU is a virtual logical core. After hyper-threading is enabled, a CPU core contains two vCPUs.
A flavor defines the number of vCPUs. You can query the number of vCPUs that an x86 ECS has by referring to Querying the Number of vCPUs of an ECS.
Hyper-threading is enabled for most x86 ECSs by default. If hyper-threading is disabled during the x86 ECS creation or specification modification, the number of vCPUs queried from the x86 ECS is half of the number of vCPUs defined by the ECS flavor.
For example, for an ECS with the c7.xlarge.2 flavor (hyper-threading enabled by default), it has four vCPUs, which means four hyperthreads. After hyper-threading is disabled, it has two vCPUs, which means two CPU cores.
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 ECS flavors that support hyper-threading, see A Summary List of x86 ECS Specifications.
Enabling or Disabling Hyper-Threading (During ECS Purchase)
- Log in to the management console and access the Buy ECS page.
Configure basic, network, and advanced settings for ECSs based on service requirements. For details, see Purchasing a Custom ECS.
- Select Configure now to configure advanced options.
- Select Specify CPU options.
Figure 1 Specifying CPU options
- 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.
- Click Next: Confirm to confirm the settings and complete the ECS purchase.
After purchasing an ECS, you can query the hyper-threading status by referring to the cpu_options parameter in Querying Details About an ECS.
Enabling or Disabling Hyper-Threading (During ECS Flavor Change)
- Log in to the management console.
- Click in the upper left corner and select your region and project.
- Click . Under Compute, click Elastic Cloud Server.
- 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.
- 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
- Click Next.
- Confirm the settings, read and select the agreement, and then click Submit Application.
After modifying ECS specifications, you can query the hyper-threading status by referring to the cpu_options parameter in Querying Details About an ECS.
Querying the Number of vCPUs of an ECS
You can log in to an ECS and view the number of its vCPUs.
- For Linux ECSs:
- Log in to a Linux ECS.
- Run the following command to view the number of logical cores of the ECS:
As shown in Figure 3, CPU(s) indicates the number of logical cores.
- For Windows ECSs:
- Log in to a Windows ECS.
- Choose Control Panel > Device Manager and expand Processors to view the number of logical cores (threads) of the ECS.
Figure 4 Viewing the result
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot