Hi.
I’m no expert and probably I am doing something a bit stupid, but I have a Hyper-V server and it isn’t working as I would have thought it should.
The box is a HP DL380 G9 with dual E5-2650V3 CPUs and 96GB in HP-recommended memory layout.
Initially I noticed a problem with a daily task in a VM which some days would run as expected and some days would run slowly. After a bit of messing around I found that if I pinned the task to cores in CPU0 then it would always run ok.
I am now rebuilding that server so thought I would try to figure out what is happening. It is a clean Win2012R2 Standard install, fully patched and the server has all the latest HP drivers, firmware and BIOS. All BIOS virtualization options enabled.
The following tests were all run on the Hyper-V host and not in a VM, there are not yet any VMs running on this server.
As a test I did a little program which does a bit of work against each core and times how long it takes (c# build as debug, 64-bit if > 32 cores):
static void Test2()
{
for (int p = 0; p < Environment.ProcessorCount; p++)
{
Process.GetCurrentProcess().ProcessorAffinity = (IntPtr)((long)1 << p);
Stopwatch sw = Stopwatch.StartNew();
long r = 0;
for (int x = 0; x < 20000000; x++)
r = (r + DateTime.Now.Ticks) % 1234567890;
Console.WriteLine("{0,2} {1,5:0}", p + 1, sw.ElapsedMilliseconds / 1000);
}
}
The results being (core number, time in seconds):
1 6
2 6
3 6
4 6
5 7
6 7
7 6
8 6
9 6
10 6
11 6
12 16
13 16
14 16
15 16
16 16
17 16
18 16
19 16
20 16
So it seems to run ok on all the cores in CPU0 and the first core in CPU1 but all the other CPU1 cores run slowly. This test was with hyperthreading turned off but I have run with HT on and the first 22 cores have good performance and the remaining 18 slower
so HT has the same pattern.
I then made a boot profile without the hypervisor and re-ran the same test and all the cores performed as expected, all taking 6 seconds.
I then rebooted back into the hypervisor profile and re-ran the tests using the other standard Windows power schemes. The test above was with the ‘high performance’ scheme and running with ‘balanced’ and ‘low power’ schemes did what you would expect for
the first 11 cores (i.e. they took a bit longer to process) but the remaining cores always take 16 seconds for the test regardless of power profile.
EDIT: I have just reset the BIOS options to system defaults and now all cores on CPU1 run slow including the first core, no idea why.
I did an even simpler simple test where I just have a command line app which just does work like the example above (but twice as much), doesn’t do any affinity setting and tells me how long it took.
Running it a few times from a command prompt without any options (so no affinity setting), it takes anything between 13 and 27 seconds. Running with START /AFFINITY 3FF to fix to the 10 cores on CPU0 always takes 13 or 14 seconds. So depending on which cores
the Windows scheduler decides to puts the program on, it could take twice as long to run which doesn’t seem right… I ran the same test from the non-hypervisor boot profile and it always takes 13 or 14 seconds without any affinity setting.
Things I have tried but have had no effect: Hyper-V NUMA spanning option; HP BIOS has options for ‘clustered’ and ‘flat’ NUMA mode, tried both.
So I guess I would like to know if this would be expected behaviour in Hyper-V for this CPU type and I am just confused and shouldn’t be concerned? If not then might it be a Hyper-V configuration issue or a HP firmware/bios/driver setting/problem?
I figure I have done something wrong somewhere but just can't pinpoint where that might be...