none
Set the preferred NUMA node of a service RRS feed

  • Question

  • We would like certain services to run on certain NUMA nodes. When running SC preferrednode <service> we lose the setting after a reboot which is not desireable. Any idea why that happens or any other way to set this and have it retained after restart?
    Tuesday, January 2, 2018 2:00 PM

Answers

  • sc.exe is calling ChangeServiceConfig2(SERVICE_CONFIG_PREFERRED_NODE), this would be the API to investigate if the config can be made persistent instead of volatile.

    https://msdn.microsoft.com/en-us/library/windows/desktop/dd405510%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 2, 2018 4:29 PM

All replies

  • sc.exe is calling ChangeServiceConfig2(SERVICE_CONFIG_PREFERRED_NODE), this would be the API to investigate if the config can be made persistent instead of volatile.

    https://msdn.microsoft.com/en-us/library/windows/desktop/dd405510%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 2, 2018 4:29 PM
  • You can also set the ProcessAffinityMask in the IMAGE_LOAD_CONFIG_DIRECTORY64 section of the executable. It only supports a 64-bit affinity mask, but few systems have more CPUs than that. The old ImageCfg tool (I think it was in the SDK) could set those bits. If you can't find a copy of ImageCfg, you could write your own tool to do it. The only problem with this approach is that it is static, whereas Doron's approach can be dynamic and more flexible.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Tuesday, January 2, 2018 8:46 PM
    Moderator