Replies: 2 comments
-
Going convert it to a discussion, since it's not really an issue, and most likely belongs to runtime rather F# than compiler. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Cherosev were you able to identify the trick to get .net to utilize all the logical processors on dual CPU setup? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I allready postet this question at (microsoft docs)[https://docs.microsoft.com/en-us/answers/questions/760023/how-do-i-configure-my-multithreaded-net-6-applicat.html], but they redirected me here.
I'm trying to migrate a project from .NET Framework 4.7.2 to .NET 6, but the performance of my program has dropped significantly. Parts of the program exploit parallelism for bulk operations on a server with 96 Cores and 192 Logical processors split across 4 CPU groups.
I'm running the program on a Windows Server 2016 with the .NET 6 Runtime installed (.NET 6 SDK not installed). The project is written in F# 6.0.
In .NET Framework 4.7.2 we used the following
app.config
-file which successfully made the program run across all 192 Logical processors, achieving ~98% CPU utilization:After migrating to .NET 6 (and by extension .NET Core) the CPU utilization dropped, and I am having trouble increasing it again.
According to Microsoft's own documentation
app.config
is not used to configure .NET Core projects, replaced by[appname].runtimeconfig.json
. To accommodate this change i have added aruntimeconfig.template.json
to my project:This produces the following
[appname].runtimeconfig.json
-file:The property
System.GC.CpuGroup
seems to work, giving me a peak of ~28% CPU utilization by distributing threads across a single CPU Group:Now I need to distribute threads across different CPU Groups.
Thread_UseAllCpuGroups
was omitted due to this documentation saying the variable is N/A inruntimeconfig.json
, and must be set as an environment variable.According to Trying to use Thread_UseAllCpuGroups in a .Net Core app this only works when set at the command line, but i have tried multiple ways of setting it:
set COMPlus_Thread_UseAllCpuGroups=1
before running my program.Control Panel -> System and Security -> System -> Environment Variables
.launchSetting.json
-file with the variable and copying it to the output directory.program.fs
-file usingSystem.Environment.SetEnvironmentVariable("COMPlus_Thread_UseAllCpuGroups", "1")
.None of the above methods have worked, and I am unsure what I am doing wrong, especially given how few posts I can find online on this issue.
Finally my question is: How do I make my .NET 6 console application utilize all my logical processors?
Beta Was this translation helpful? Give feedback.
All reactions