PreferredNode of a service not working anymore using WS2022

Klein, Matthias 1 Reputation point


I was using the preferredNode attribute for services (sc preferredNode <ServiceName> #Node) in the past to set the initial Numa node memory and cpu affinity.

Since I switched to Windows Server 2022 (OS Build 20348.1249) the cpu affinity is not working anymore. The underlying executable is always pinned to Node 0.

I double checked the behavior on a WS2019 instance, there it works fine, setting preferredNode to 1 starts the executable with cpu affinity at Node 1.

Anyone facing the same problem and found a solution?



Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,613 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Klein, Matthias 1 Reputation point

    Hello Wesley,

    thanks for your reply.
    Unfortunately there are no logs showing the issue.

    I create some screenshots to show you the issue I am facing.

    • How I set the preferredNode for my service


    • Start service


    • check affinity


    As said... using the same procedure on versions < WS2022 works fine.
    The server has 8 Numa Nodes.

    Any help appreciated.

    Thanks and cheers

  2. Wesley Li-MSFT 4,401 Reputation points Microsoft Vendor


    Starting with windows 10 Build 20348, NUMA support has changed, see if this event helps your problem:

    0 comments No comments

  3. Klein, Matthias 1 Reputation point

    Hello Wesley,

    thanks for your reply. I was already aware about the changes regarding NUMA with this build.
    Unfortunately I am not recoding an application to make use of the new functionalities, I want to use existing tools like start.exe, sc etc. to configure NUMA affinity.
    Is there a way to set the affinity via powershell or command line instead of selecting the process via task manager and setting the affinity manually?

    Thanks and cheers