OS Version Information:
[[email protected] system]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core)
Configuration for the test.slice is as follows:
[[email protected] system]# cat test.slice [Unit] Description=Test Slice Documentation=man:systemd.special(7) DefaultDependencies=no Before=slices.target Wants=-.slice After=-.slice [Slice] CPUAccounting=on CPUShares=1024
I created another file just like this (call it testhigh.slice) and gave it CPU shares = 128. When I launch CPU hungry processes in either slice, I see CPU get proportionally divided, as expected.
However, there seems to be no way to actually throttle the CPU of one slice to a constant e.g. 10%. The CPUQuota option is not recognized by systemd:
Apr 23 21:34:00 localhost.localdomain systemd: [/usr/lib/systemd/system/test.slice:22] Unknown lvalue 'CPUQuota' in section 'Slice'
In principle, being able to allocate resources precisely would be amazing, but right now I cannot get this to work. Please help; I want a solution from inside the systemd framework, if possible.