Enabling or Disabling Hyper-Threading
Scenarios
When purchasing an x86 ECS, you can enable or disable hyper-threading by specifying CPU options. By default, hyper-threading is enabled.
- If you require CPU cores to concurrently process a large amount of data and background tasks, enabling hyper-threading can greatly improve compute 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
x86 ECSs support hyper-threading, which enables two threads to run concurrently on a single CPU core. Each thread is represented as a virtual CPU (vCPU). When hyper-threading is enabled, each CPU core contains two vCPUs available to your workloads.
A flavor defines the number of vCPUs. You can query the number of vCPUs from an x86 ECS has by referring to Querying the Number of vCPUs from 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, the c7.xlarge.2 flavor defines four vCPUs, which means four threads. If hyper-threading is disabled, there are two vCPUs, mapping to two CPU cores.
Constraints
- For details about ECS flavors that support hyper-threading, see A Summary List of x86 ECS Specifications.
- Enabling or disabling hyper-threading does not generate additional costs.
- Once an x86 ECS is purchased, its hyper-threading status cannot be directly changed. To change the hyper-threading status, you need to modify the instance specifications.
Enabling or Disabling Hyper-Threading (During ECS Purchase)
- Log in to the ECS console and access the Buy ECS page.
Configure parameters required for purchasing ECSs, including basic, instance, and OS settings. For details, see Purchasing an ECS in Custom Config Mode.
- Select Specify CPU options in Advanced Settings.
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 a region and project. - Click
. Under Compute, choose Elastic Cloud Server. - In the ECS list, locate the row that contains 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 agree to 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 from an ECS
You can log in to an ECS and query the number of vCPUs.
- For Linux ECSs:
- Log in to an ECS.
- Query the number of vCPUs from the ECS.
As shown in Figure 3, CPU(s) indicates the number of vCPUs.
- For Windows ECSs:
- Log in to an ECS.
- Choose Control Panel > Device Manager and expand Processors to view the number of vCPUs (threads) in 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
