Openrc has extended cgroups support

Staring with openrc-0.12 (not released ATM) openrc supports cgroup limit configuration. The simpliest and most reasonable way to configure it is use a multiline per-process values:

At first I should note that openrc has optional cgroup support to add it you need to set:

rc_controller_cgroups="YES"

Otherwise one of the option will be applied and openrc “plugin” will not be loaded. As always settings can be set in rc.conf file and can be overloaded in ‘/etc/conf.d/foo’ file for service foo.

Each option is specified by name of the limit and value. Each option may be a multivalue, e.g.

# rc_cgroup_cpu="
# cpu.shares 512
# "

For more information about the adjustments that can be made with cgroups, see Documentation/cgroups/* in the linux kernel source tree.

Currently next controllers are supported:

Why do I ever need cgroups?

You can check kernel documentation. But roughly speaking you can monitor service processes, and manage resources much better.

Differences with other system managers

There are some differences between how systemd works, systemd creates hierarchies for system daemons and users in each controller. Openrc uses it’s own cgroup to monitor daemons, and create a group called ‘openrc_’ in controller that is configures.

So you can easily use other cgroup daemons like libcgroup with openrc without any problem

Future work

There are some work that can be done to make cgroup support better:

Usefull links:




comments powered by Disqus