I use to assign RoonServer processes to a dedicated core of the CPU (4 cores). I do this by and at each boot using taskset command.
I have to use, for example : taskset -cp 2,3 7992 to assign process ID 7992 to core 2 and 3.
Is there a way to do this automatic at each boot ? I had a look at /opt/RoonServer/start.sh script but I can’t figure where I can ad the taskset command.
You may want to take a look at numactl instead as I think taskset will be depreciated one day.
You’ll need to run something along the lines of sudo numactl --cpunodebind=0 /opt/RoonServer/Server/RoonServer.
Edit /opt/RoonServer/start.sh and change the exec command near the bottom of the script. Whether this will work is debatable since roonserver will call the Mono executables and these may well be scheduled by the Linux kernel.
I think I have seen a dealer doing the same thing on a EUR24000 Windows Roon server, and a Roon user doing the same thing (again on Windows) in another forum.
I would group this kind of tweak with things like OS optimizer, underclock, undervolt, etc.
Not that it’s relevant for your situation, but if you were running windows you could use process lasso from https://bitsum.com for assigning a process to a specific core.
An example: I have room and HQP assigned to the physical cores.
You can run multiple processes real-time without losing stability or responsiveness thanks to process lasso.
Very helpful app and free!
Theoretical is right, since there is no actual practical benefit. Roon Server pre-buffers ~5 seconds of audio to the endpoint. So any minute (or even large) loss of CPU slices won’t affect it. If this was to have any affect, it’d have to be applied to RoonBridge on the endpoint. And even there… it won’t matter.
How do you prevent the OS from using that CPU core though? I mean you can fix the Roon process to it, but you cant be sure the OS wont use it anyway.
EDIT: Personally the only thing I do on my roon server is boost the priority of the Roon process a bit. Since my server is dedicated to Roon and nothing else this doesnt seem to be a disruptive thing to do, but maybe improves reponsiveness etc.
If you look at roonserver.service you’ll see that it calls start.sh. Look for …
if [ $R -eq 122 ]; then
exec $0 "$@"
fi
I doubt there is any practical benefit. Indeed, performance may be degraded. Why would you want to run all threads on a single core when other cores could be utilise when they’re sitting idle?
I change this line to : exec taskset -c 2 $0 "$@"
And at startup RoonServer is executed on core 2 as expected.
But the very first process : root 632 0.0 0.0 6640 3208 ? Ss 09:21 0:00 /bin/bash /opt/RoonServer/start.sh
is still on the first core.
Any idea to move in on core 2 at startup ?
Thank you