EC2、Windows 10、一半的虚拟处理器

fsk*_*exp 5 hyperthreading amazon-ec2 windows-server-2019

我们运行t3.largem5.large实例,它们有 2 个 vCPU(如 EC2 管理控制台中所示)。我试图理解为什么 Windows 2019(我的 IT 提供的 AMI)只能看到逻辑 CPU 数量的一半。

  • 一半的数字在任务管理器、msinfo32 和 Coreinfo 中报告。我们还看到较大实例的数量减少了一半(xlarge:2 而不是 4)。
  • 如果我while($true){}在 PowerShell 中运行,任务管理器将报告 100% 的使用率,但 Cloudwatch 将报告 50%。
  • 在 msconfig 中,我只能选择 1 个 CPU(对于大型实例)。
  • 当我在 EC2 向导中创建我的实例时,我使用了默认数量的 vCPU。
  • 如果我使用市场上的 Windows 2019 AMI,我将获得正确数量的逻辑处理器。在这两种情况下,它都是相同的版本/内部版本(Windows Server 2019 Datacenter)。

您是否知道 Windows 10 中可能影响检测到的逻辑处理器数量的任何配置?或者,如果我可以激活任何日志以查看如何检测 CPU(如dmesg在 linux 中)。我的 IT 同事告诉我,他们没有对 CPU 数量或超线程进行任何更改,但看起来他们的 AMI 有一些特别之处。

更新:在事件查看器中,在“Microsoft/Windows/Kernel-PnP”中,我可以看到:

设备 ACPI\GenuineIntel_- Intel64_Family_6_Model_79 -_Intel(R)_Xeon(R) CPU_E5-2686_v4 @_2.30GHz_1 已配置。

设备 ACPI\GenuineIntel_- Intel64_Family_6_Model_79 -_Intel(R)_Xeon(R) CPU_E5-2686_v4 @_2.30GHz_0 已配置。

我不知道是否有任何其他日志可以说明何时将任何 CPU/核心/线程初始化为逻辑处理器。

更新 2:我比较了有问题的机器和正常工作的机器的内容bcdedit /enum All和内容,结果bdcedit /v是一样的(UUID 除外)。我试图明确设置bcdedit /set NUMPROC 2并重新启动,但没有结果。bcdedit /v

Windows Boot Manager
--------------------
identifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795}
device                  partition=C:
description             Windows Boot Manager
locale                  en-US
inherit                 {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
bootshutdowndisabled    Yes
default                 {61a8a653-e7da-11e8-a960-0e221fdbf186}
resumeobject            {61a8a652-e7da-11e8-a960-0e221fdbf186}
displayorder            {61a8a653-e7da-11e8-a960-0e221fdbf186}
toolsdisplayorder       {b2721d73-1db4-4c62-bf78-c548a880142d}
timeout                 30

Windows Boot Loader
-------------------
identifier              {61a8a653-e7da-11e8-a960-0e221fdbf186}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows Server
locale                  en-US
inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
recoverysequence        {74e13b1d-b199-11ea-827a-0af4c9a8ea6d}
displaymessageoverride  Recovery
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {61a8a652-e7da-11e8-a960-0e221fdbf186}
nx                      OptOut
bootstatuspolicy        IgnoreAllFailures
Run Code Online (Sandbox Code Playgroud)

小智 3

当在操作系统级别禁用超线程时,会出现此问题。这可能是根据 Microsoft 建议进行的,以防止已知的漏洞(称为推测执行侧通道 [1])。

\n

根据“防止推测执行侧通道漏洞的 Windows 指南”[2],启用了 Windows 更新并应用了 2019 年 7 月 9 日发布的安全更新的客户将受到自动保护。无需进一步配置。

\n

为了解决这个问题,我建议使用以下步骤启用超线程:

\n
1. Confirm that Hyper-Threading is disabled by querying the registry using below command:\n\n    \xe2\x80\xa2   reg query "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management" /v FeatureSettingsOverride \n\n    The Hyper-Threading will be disabled if the output is:\n\n    \xe2\x80\xa2   HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management\n    \xe2\x80\xa2   FeatureSettingsOverride    REG_DWORD    0x2048\n\n2. Once confirmed, proceed with enabling the Hyper-Threading using the below command:\n\n    \xe2\x80\xa2   reg add "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 0 /f\n\n3. Restart the instance and check the number of vCPU reported in the OS, which should show the correct number.\n
Run Code Online (Sandbox Code Playgroud)\n

参考:

\n\n