Post Reply 
Minimserver CPU Affinity
27-01-2024, 01:10
Post: #1
Minimserver CPU Affinity
Hello, I've a music server that runs multiple services, I'd love to have the capability to bind affinity of cores to Minimserver services (running Minimserver 2.2 on Ubuntu 22.04).

I've seen some of the archive topics back in 2020 in the forum, and I am not able to make it work by creating a minimstart.conf with the taskset command.

Is there a new way on configuring the Minimserver2 to bind to specific number of cores?

Appreciate some advise
Find all posts by this user
Quote this message in a reply
27-01-2024, 11:44
Post: #2
RE: Minimserver CPU Affinity
As someone who is ignorant, paradis, I wonder if you to tell me the advantages of binding affinity of cores in CPUs?
Thanks
Find all posts by this user
Quote this message in a reply
27-01-2024, 14:31
Post: #3
RE: Minimserver CPU Affinity
Nothing has changed since 2020. As it can be tricky to set this up, here are detailed step-by-step instructions.

1) Create a file named runjava.sh using a text editor. You can put this anywhere. For the rest of these instructions I will assume this file is in your home directory /home/your-user-name. If you want to run MinimServer on CPU core 2 (for example), this file should contain the following:

#!/bin/bash
exec taskset -c 2 java "$@"

2) Give the runjava.sh file executable permission by running this command:
chmod 755 /home/your-user-name/runjava.sh

3) Create a file named minimstart.conf using a text editor. This file must be in the minimserver/etc directory. If you have installed MinimServer in your home directory, the full path to this file will be /home/your-user-name/minimserver/etc/minimstart.conf. This file should contain the following:

java=/home/your-user-name/runjava.sh

4) Stop MinimServer and start it again.

5) To check that MinimServer is running on CPU core 2, run this command:
ps -eo psr,command | grep mserver

6) The output from this command should include a line similar to the following:
2 java -jar /home/your-user-name/minimserver/lib/mserver.jar --launchrc --set watch.view=log --nohup

7) The number '2' at the start of the line is the CPU core that is running MinimServer
Find all posts by this user
Quote this message in a reply
27-01-2024, 16:34
Post: #4
RE: Minimserver CPU Affinity
(27-01-2024 11:44)Donuk Wrote:  As someone who is ignorant, paradis, I wonder if you to tell me the advantages of binding affinity of cores in CPUs?
Thanks

Just a little bit OCD side of things really, I have P cores which reserved for some workload thats heavy and didn't want others to disturb as the workload will uses up fair amount of CPU resource by doing some audio up sampling, hence reserving the E cores for others like Minim
Find all posts by this user
Quote this message in a reply
27-01-2024, 16:35
Post: #5
RE: Minimserver CPU Affinity
(27-01-2024 14:31)simoncn Wrote:  Nothing has changed since 2020. As it can be tricky to set this up, here are detailed step-by-step instructions.

1) Create a file named runjava.sh using a text editor. You can put this anywhere. For the rest of these instructions I will assume this file is in your home directory /home/your-user-name. If you want to run MinimServer on CPU core 2 (for example), this file should contain the following:

#!/bin/bash
exec taskset -c 2 java "$@"

2) Give the runjava.sh file executable permission by running this command:
chmod 755 /home/your-user-name/runjava.sh

3) Create a file named minimstart.conf using a text editor. This file must be in the minimserver/etc directory. If you have installed MinimServer in your home directory, the full path to this file will be /home/your-user-name/minimserver/etc/minimstart.conf. This file should contain the following:

java=/home/your-user-name/runjava.sh

4) Stop MinimServer and start it again.

5) To check that MinimServer is running on CPU core 2, run this command:
ps -eo psr,command | grep mserver

6) The output from this command should include a line similar to the following:
2 java -jar /home/your-user-name/minimserver/lib/mserver.jar --launchrc --set watch.view=log --nohup

7) The number '2' at the start of the line is the CPU core that is running MinimServer

Thanks. That's very clear, I will give it a try and see how it goes
Find all posts by this user
Quote this message in a reply
28-01-2024, 06:38
Post: #6
RE: Minimserver CPU Affinity
I just want to report it that work a treat, I managed to get it working and crosscheck the pid are indeed ties to the affinity cores assigned.

Thank you v much!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)