Need help with Core Isolation, Bridging, etc

Hi all,

I’m building a server to exclusively run Roon Server and am looking at doing the following:

a) Set a static CPU frequency (lower than what the CPU normally runs at). CPU is an Intel Xeon Gold 6138.

b) Setting up CPU Core Isolation / Affinity to have certain processes run on certain cores.

c) Bridge 2 ethernet ports on the server.

I would be grateful if someone could point me in the right direction to get this done.

Thanks,

1 Like

Hello and welcome to the forum.
To set a static CPU frequency you can change the CPU Governor in dietpi-config -> Performance Options -> CPU Governor to userspace and set a fixed frequency.

To setting up CPU affinity you can use the command taskset.
E.g. to run nvim only on core 0 and 1 you do:

taskset -c 0,1 nvim

This setting will not survive a reboot, so you would need to setup a startup script or a systemd service or something similiar, to apply this at boot.

For bridging ethernet ports you would need to edit /etc/network/interfaces. In this example we bridge eth0 and eth1 to br0:

iface eth0 inet manual
iface eth0 inet6 manual
iface eth1 inet manual
iface eth1 inet6 manual

auto br0
iface br0 inet static
    address 192.168.178.42
    netmask 255.255.255.0
    bridge_ports eth0 eth1

Then restart the network with sudo ifdown -a && sudo ifup -a.

Instead of using a static address you can of course also use DHCP. Tweak the values to your likings.

1 Like

This is brilliant. Thank you for your quick and detailed reply. I will try this tonight.

I’m a bit of a newbie so sorry for being a pain but could you please let me know how to do this:

“This setting will not survive a reboot, so you would need to setup a startup script or a systemd service or something similiar, to apply this at boot.”

1 Like

You can run dietpi-autostart and select the option 14: Custom script (background ...) and then edit the file /var/lib/dietpi/dietpi-autostart/custom.sh.

Add the following lines (in this example we set nvim to run just on core 0:

/usr/bin/taskset -c 0 nvim

Save the file and from now on at each reboot it will be executed.

Great, so if I had multiple cores to set, I would just add multiple lines?

/usr/bin/taskset -c 0 nvim
/usr/bin/taskset -c 1 abcd
/usr/bin/taskset -c 2 xyze

Exactly.

1 Like

Hi,
Installed Dietpi and managed to get the bridge working but had to run the following as well:

apt install bridge-utils
reboot
brctl addbr br0
brctl setfd br0 0
brctl addif br0 eth0 eth1

I’m now facing another issue. I have a USB drive plugged in to the PC and have mounted it. However, I am unable to access it from within Roon. It says ‘unauthorised’. I cant figure out how to set permissions to allow all users access.

Thank you.

What filesystem does the USB drive use?
Recommended way to access your music is to copy it into /mnt/dietpi_userdata/Music.
https://dietpi.com/docs/software/media/#__tabbed_17_3

Otherwise you need to adjust the permissions manually, like:

chmod 0755 /path/to/music
chown -R roonserver:root /path/to/music

Can you share also the logs:

journalctl -u roonserver
cat /var/log/roonserver

Thank you. That worked.
Is there a way to find and delete / disable unused processes?
I want only the minimum processes running.
Thanks

DietPi is already running a minimum of process by default. Usually processes added by user actions, configuration or software installations.

1 Like