How to overcome Processor Groups affinity in Windows Server 2022

Anonymous
2024-03-01T10:07:21+00:00

I use a server with two Xeon Gold 6248R CPUs (48 logical cores each) with Windows Server 2022 OS to run simulations using both own Python scripts and external programs (Scenario Generator from Moody's, which generates economic projections and supports parallelization to do so). The OS always seems to send all the threads of a single application to a single CPU.

For parallelisation in Python I have tried Multiprocessing and Ray packages, but both have the same behaviour: all threads run on just one Xeon which corresponds to one processor group in my case, though they detect 96 logical cores. I suspect that my computaitons will be better off using all the cores, cause there is little communication between the threads. I have read that beginning with Windows Server 2022/Windows 11 appplicaitons are no longer constrained to a single processor group and that CPU affinity spans across all cores per default. Does anyone know how to force OS to allow usage of both Xeons for one task at once in my case?

Some system info:

OS Name: Microsoft Windows Server 2022 Standard
OS Version: 10.0.20348 N/A Build 20348
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Server
OS Build Type: Multiprocessor Free
System Manufacturer: Dell Inc.
System Model: PowerEdge R640
System Type: x64-based PC
Processor(s): 2 Processor(s) Installed.
[01]: Intel64 Family 6 Model 85 Stepping 7 GenuineIntel ~2993 Mhz
[02]: Intel64 Family 6 Model 85 Stepping 7 GenuineIntel ~2993 Mhz

My Python info:

python 3.11.5

ray 2.8.1

installed via Conda

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

6 answers

Sort by: Most helpful
  1. Anonymous
    2024-03-04T08:14:58+00:00

    Hello

    Thank you for posting in Microsoft Community forum.

    In Windows Server 2022, processor groups are no longer a constraint for applications, and CPU affinity spans across all cores by default. However, it is still possible that some applications may not be optimized to take advantage of this change.

    To force an application to use all available cores, you can try setting the CPU affinity manually. This can be done using the Task Manager or the command line.

    To set CPU affinity using the Task Manager:

    1. Open the Task Manager by pressing Ctrl+Shift+Esc.
    2. Go to the Details tab and find the process you want to modify.
    3. Right-click on the process and select Set affinity.
    4. Check the boxes for all available processors and click OK.

    Note that setting CPU affinity manually may not always result in better performance, and it may also cause other issues if not done correctly. It is recommended to test the performance of your application before and after making any changes to CPU affinity.

    Best Regards,

    Zack Lu

    0 comments No comments
  2. Anonymous
    2024-03-04T08:42:46+00:00

    Hi Zack! Thank you for your suggestion. Unfortunately it does not help in my case since in task manager I have to select processor group first, and if I select another one, than the first one gets "deselected"

    2 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2024-05-19T17:07:51+00:00

    Same here. Only 40% cpu usage while python RF model training. server 2019 is OK for 100% cpu...

    0 comments No comments
  4. Anonymous
    2024-05-19T18:12:45+00:00

    Hello Ilia Ozornov,

    Did you not have to choose while installing server 2022 how many CPU groups you wanted?

    I can imagine that you would choose for two, but in your case I would just choose one.

    The operating system would then default to use all CPU's with all cores for all threads.

    0 comments No comments
  5. Anonymous
    2024-05-27T07:07:37+00:00

    Hi Bjarne,

    I am not sure what was done during server 2022 installation cause IT department did it. But I guess they would use some default setting. As far as I understand from reading about Win Server 2022, it still cannot put more than 64 vCPUs into one group and I have 96 vCPUs here. It still must be able to allocate tasks across two CPU groups.

    Best regards,

    Ilia

    0 comments No comments