[systemd-devel] systemd219 and Realtime priority

Jon Sykes jono.sykes15 at gmail.com
Thu Nov 7 17:14:39 UTC 2019


Hi,

I'm using RHEL7 with systemd-219-62.el7_6.6.x86_64. I've recently hit an
issue whereby a process started by a systemd service cannot assign itself
realtime priority. Digging into the issue it seems that it is because
systemd starts all services within a cpu/system.slice/<service_name> cgroup
which by default wont be allocated any rt runtime through
the cpu.rt_runtime_us value.

I searched for info on how to solve this issue and came across
https://www.freedesktop.org/wiki/Software/systemd/MyServiceCantGetRealtime/
unfortunately
2 of the 3 suggestions don't seem to be valid anymore:

- /etc/systemd/system.conf and set DefaultControllers=
This appears to have been removed as an option. When I tried this it had no
effect

- edit your service file, and add ControlGroup=cpu:/ to its [Service]
 section
This doesn't appear to be a valid option anymore:
https://bugzilla.redhat.com/show_bug.cgi?id=999986

This only leaves the option of setting cpu.rt_runtime_us value for the
unit, however, there are a number of reasons why this isn't ideal and if
the root cgroup config changes at any point then the value I choose isn't
guaranteed to do what I had intended. (as pointed out in:
https://lists.freedesktop.org/archives/systemd-devel/2015-March/029144.html)

Is there any other way to get my service to run within a cgroup that allows
it to assign itself realtime priority? It would seem preferable to be able
to just run the service in the root cgroup - is this possible through
configuration?

Thanks
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20191107/741b81a1/attachment.html>


More information about the systemd-devel mailing list