Problem description
The number of logical processors displayed in the operating system is less than the number of vCPUs specified for the ECS instance type.
Causes
BOOT parameter limitation: A parameter that limits the number of processors, such as numproc or onecpu, is set in the Windows Boot Configuration Data (BCD).
Hyper-threading is disabled: The Threads per core setting in the ECS instance configuration is set to 1, or a registry key has disabled hyper-threading.
Solution
Step 1: Clear the BOOT parameter limitation
Use the command line to remove the boot parameter that limits the number of CPU cores.
Log on to the ECS instance.
Go to ECS console - Instances. In the top navigation bar, select the target region and resource group.
Go to the details page of the target instance, click Connect, and select Workbench. Set the connection method to Terminal, enter the username and password, and then log on to the graphical terminal page.
Clear the BOOT parameter limitation.
Right-click the
icon, click Run, enter powershell, and press Enter.Execute the following command to query the current boot configuration.
bcdeditCheck the command output for
numprocoronecpu. If either parameter exists, execute the following command to delete it. Replace<identifier>with the Windows boot loader identifier from the command output in the previous step.# Delete the processor count limit bcdedit /deletevalue "<identifier>" numproc # Delete the single-processor mode limit bcdedit /deletevalue "<identifier>" onecpuIf the identifier is
{current}, executebcdedit /deletevalue "{current}" numprocandbcdedit /deletevalue "{current}" onecpuas needed.Restart the instance for the configuration to take effect.
Step 2: Enable ECS Hyper-Threading
If no boot parameters are limiting the CPU count, check the hyper-threading configuration of the ECS instance.
Stop the instance.
You can change CPU options only when the instance is in the Stopped state.
Modify the configuration.
Go to ECS console - Instances.
Click the ID of the destination instance to open the details page. In the Configuration Information section, click Change CPU Options.
In the dialog box that appears, make sure that Threads per Core is not set to 1. A value of 1 disables hyper-threading.
Start the instance.
After you save the configuration, start the instance and verify the number of logical processors.
Step 3: Adjust the registry to fix disabled hyper-threading
If Threads per Core is not 1, you can check whether a security policy has disabled hyper-threading. For more information, see KB4072698.
Log on to the ECS instance. To open the Registry Editor, right-click the
icon, click Run, and enter regedit.Navigate to the following path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory ManagementCheck for the
FeatureSettingsOverrideandFeatureSettingsOverrideMaskkeys. If these keys exist, ensure that the value ofFeatureSettingsOverrideis 72 and the value ofFeatureSettingsOverrideMaskis 3.Restart the instance for the configuration to take effect.