Message boards : Number crunching : Resource Management with Systemd and Cgroups: Setting CPU Affinity in Linux
Message board moderation

To post messages, you must log in.

AuthorMessage
cuphi

Send message
Joined: 17 Jun 21
Posts: 12
Credit: 2,655,004
RAC: 0
Message 46684 - Posted: 26 Apr 2022, 13:38:42 UTC

Because I had to read a lot of docs before I found the solution to my problem I am posting this here to help anyone else that may come along in the future.

I have a nice beefy Ryzen 9 system that I use as my crunching box and as a gaming server. It's running OpenSuse Linux. In order to keep the two roles from competing from resources I have the game servers installed in LXD containers and set them to us one half CPUs on my system. I was running my Atlas native tasks in a VM that I configured to use the other half of the CPU be Singularity can't run in an LXD container. However I was loosing a crunching power to the overhead of the VM. After stumbling through several false start I finally learned how to set CPU affinity for services using Systemd:

sudo systemctl set-property autofs.service AllowedCPUs=8-15,24-31
sudo systemctl set-property boinc-client.service AllowedCPUs=8-15,24-31


It's as simple as that. Now I am crunching without the VM on exactly half my CPU cores while my game servers use the other half.
ID: 46684 · Report as offensive     Reply Quote

Message boards : Number crunching : Resource Management with Systemd and Cgroups: Setting CPU Affinity in Linux


©2024 CERN