Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to apply a systemd cgroup/slice #4

Open
petecallaghan opened this issue Jul 8, 2021 · 11 comments
Open

Add option to apply a systemd cgroup/slice #4

petecallaghan opened this issue Jul 8, 2021 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@petecallaghan
Copy link
Owner

No description provided.

@petecallaghan petecallaghan self-assigned this Jul 8, 2021
@petecallaghan
Copy link
Owner Author

petecallaghan commented Jul 9, 2021

https://www.redhat.com/sysadmin/cgroups-part-four?extIdCarryOver=true&sc_cid=701f2000001OH7nAAG

It is possible to include existing services in a new slice (eg music.slice) as follows:

Add a drop in directory for your target service (eg mpd.service): $ mkdir -p /etc/systemd/system/mpd.service.d/

Create a drop in file for that service: $ nano /etc/systemd/system//mpd.service.d/00-slice.conf
[Service] Slice=music.slice CPUAccounting=yes

Assign the shares value: $ systemctl set-property mpd.service CPUShares=1024

Restart:
systemctl daemon-reload
systemctl restart -a mpd.service

@petecallaghan
Copy link
Owner Author

However the slice does not seem to get created until after a reboot

@petecallaghan
Copy link
Owner Author

Question to resolve: how to activate the new slice without a reboot?

@petecallaghan
Copy link
Owner Author

This may be linked to the dependencies of mpd.service. Perhaps asking mpd to stop itself might be necessary

@petecallaghan
Copy link
Owner Author

sudo service mpd stop
sudo service mpd start

Seems to do the trick

@petecallaghan
Copy link
Owner Author

The plug-in configuration should use a slider of 25-75% to identify cpu resource allocation Vs system

@petecallaghan
Copy link
Owner Author

Add distinct config for IO and memory as well, controlled by sliders

@petecallaghan
Copy link
Owner Author

On further research it is hard to see the benefit of controlling IO or memory, so that will not be part of the plugin.

@petecallaghan
Copy link
Owner Author

CPUQuota limits the % of CPU time on a single CPU. This could be useful in ensuring that the shielded processes cannot consume all of a CPU, by setting it to (eg) 95.

This could be controlled by distinct config

@petecallaghan
Copy link
Owner Author

CPUShares=value
Replace value with a number of CPU shares. The default value is 1024. By increasing the number, you assign more CPU time to the unit. Setting the value of the CPUShares parameter automatically turns CPUAccounting on in the unit file. Users can thus monitor the usage of the processor with the systemd-cgtop command.

@petecallaghan petecallaghan transferred this issue from petecallaghan/volumio-plugins Oct 29, 2021
@petecallaghan petecallaghan added the enhancement New feature or request label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant