Does .NET Core have a 64 vCPU limit?

853 Views Asked by At

I have an .NET Core application that starts up 512 Tasks that populate an AI network. I'm performing scaling tests and I've run benchmarks on 2, 4, 8, 16, 32 and 64 processor machines in Azure. All of the benchmark tests use 100% of the available vCPUs on the machine.

When I tried running the test on a M128 (128 vCPUs), the test ran at 50% CPU Utilization. I checked the environment variables and Environment.ProcessorCount told me there are only 64 processors (the documentation says this is the virtual processor count). Digging further, I find there's an architectural limit of 64 CPUs per 'Processor Group'. This machine apparently has 2 processor groups with 64 in each.

Is this a bug in .NET Core or is .NET Core limited to only one processor group?

2

There are 2 best solutions below

1
On BEST ANSWER

As per this documentation, you can enable execution on more than 64 logical processors in a single process. You need to set the following in your app.config:

<configuration>
   <runtime>
      <Thread_UseAllCpuGroups enabled="true"/>
      <GCCpuGroup enabled="true"/>
      <gcServer enabled="true"/>
   </runtime>
</configuration>

Verified working with .net framework 4.8 on windows with an AMD EPYC 7713P, which has 128 cores in total. Previously, it was only running on 64 cores; it works after adding the config.

Next, I've just got to work on the IO bottleneck...

2
On

The documentation for Environment.ProcessorCount says

If the current machine contains multiple processor groups, this property returns the number of logical processors that are available for use by the common language runtime (CLR).

I think you may need to run multiple processes (and therefor multiple instances of the CLR) to take advantage of the second group.