How to restrict windows service to X cores?
- by Martinnj
I'm currently trying ot figure out a decent/nice way of determening what core(s) a single service should run on, in Windows Server 2008.
I'm aware that for procceses there is two ways to do it:
set affinity through task manager after proccess is launched.
use "start /AFFINITY 0x1" or similar bitmask
However this does not seem to work very well with services. When i try to launch the exe that
the service will also run (the one that needs restriction) it just spawns a new commandline (and starts the process) but the process terminates shortly after.
Does anyone here know how to do a similar trick for services?
It is not important what core it is running on, it just needs to be restricted to only one.
And preferably it should be something that can be automated, so we do not have to interfere when there is a server restart.