Poor CPU performance on Hyper-V VM

Anonymous
2024-07-09T08:10:54+00:00

Recently I upgraded mine 2016 Hyper-V cluster to 2022 and I noticed very poor VM CPU performance compared to bare metal host.

Is it normal ? I ran cinebench on one core on host and on VM and the difference is huge. The host CPU performance is about 80% better than the VM (120 on VM compared to 200 on host).

TThe CPU is Intel Xeon Gold gen 4.

Windows for business Windows Server Performance System performance

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes
Accepted answer
  1. Anonymous
    2024-07-09T16:21:41+00:00

    Hello

    Thank you for posting in Microsoft Community forum.

    It's not normal for a VM to have such a significant performance drop compared to the host. There are several factors that could be causing poor CPU performance on your Hyper-V VM after the upgrade.

    Here are some steps you can take to troubleshoot and potentially improve the situation:

    Install the latest VM integration services: This can significantly reduce CPU overhead for I/O compared to emulated devices and improve the I/O throughput.

    Check for high CPU utilization issues: If you start one VM and then another, the second VM might face high CPU utilization. This could be due to the configuration or resource allocation.

    Update VM Integration Services: Ensure you have the latest version installed for performance and compatibility improvements.

    Consider VM performance tuning guidelines: There are specific configurations and settings that can be adjusted to optimize VM performance.

    Check for malware: Perform a scan to rule out any malicious software causing high CPU usage.

    Update drivers: Make sure that the drivers on both the VM and the host are up to date.

    Configure CPU resources: Hyper-V allows you to statically partition CPU resources on a host and isolate the root OS activity to a subset of logical processors.

    Additionally, you may want to review the Hyper-V processor performance considerations for fine-tuning and improving Hyper-V performance.

    Hyper-V processor performance | Microsoft Learn

    Best Regards,

    Wesley Li

    1 person found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-07-09T20:35:14+00:00

    I made some test on old host (2016) and the new host machine with new windows (2022) with the same VM (2016 guest system).

    I ran some synthetic cpu bench limited to 4 cores.

    The results:

    • host 2016 - 293
    • guest VM 2016 - 291
    • host 2022 - 730
    • guest VM 2016 - 360 (!!!!)

    The difference is huge (old host 293 drop to 291 and new host 730 drop to 360). I spent money on new hosts and system supposed to be 250% faster and got only 20% lol.

    Version of integrated servces reported on new VM guest is: IntegrationServicesVersion REG_SZ 10.0.14393

    Can I manually check actual MS version of integrated services ? How can i tell if they are up to date ? MS says that in W2016 and W2022 its automatic.

    No CPU usage on hosts or VMs. No any malware.

    One more thing.

    After moving VMs to new cluster I got many allerts pointing to high CPU wait state for dispatch (about 50-80 microseconds). But why ? On old hosts I never got those alerts. Maybe there are the problems ?

    But I do not have much overcommited vCPU to CPU. Most of the cores are idle or 5-15% busy. Even when I run only one 4 vCPU VM on 2x8cHT CPU host I get the same results.

    That spoiled all my pleasure from buying new hosts and Windows :/

    0 comments No comments
  2. Anonymous
    2024-07-11T11:00:19+00:00

    Hmm, I figured something.

    CPUs on old servers didn't have HT so Hyper-V VMs sees 4 attached vCPUs as 4 cores/4threads

    New CPUs have HT enabled and when I assigned 4 vCPU to VM, Hyper-V makes them 2 cores/4 threads acting like on physical. So at the end i received 2 core HT VM instead of 4 core.

    The results shows that clearly and so the benchmarks.

    But i have CPU intense applications on VMs licensed to cores so I extremly do not want 2 cores HT VM licensed at cost of 4 core license (SQL per vCPU for example).

    So now I have two choices.

    1. disable HT on servers physical CPUs - easy to do but i loose some performance to other VMs
    2. make that Hyper-V machines, where I need pure cores, to see 4 vCPU as 4 cores instead 2/4.

    Is there a way to configure individual VM (Windows 2016/2022) to see 4vCPU as 4 cores/4 threads ?

    0 comments No comments
  3. Anonymous
    2024-07-29T09:37:43+00:00

    To configure individual VMs to see 4 vCPUs as 4 cores/4 threads, you might need to adjust the VM's settings in the Hyper-V Manager. Typically, you can specify the number of virtual processors and, if available, the number of cores per virtual processor in the VM's settings. However, this can depend on the version of Hyper-V and the guest operating system's capabilities.

    If the Hyper-V Manager does not provide the option to configure the cores/threads as you desire, you may need to consider other solutions, such as:

    • Disabling Hyper-Threading (HT) at the BIOS level, as you mentioned, which could impact other VMs.
    • Looking into whether there are any advanced settings or PowerShell scripts that can modify the VM's configuration to treat vCPUs as separate cores rather than threads.
    0 comments No comments