As I understand it (please correct me if I'm wrong),
systemctl set-property ... CPUShares=some_value
limits the cpu time for an entire cgroup unit. If we instead want to limit cpu time for a process within that unit, we can run the process with
systemd-run ... nice=some_value
I'm wondering if there's some intrinsic difference between the concepts of the nice-value of a process and the CPUShares-value of a group of processes? Can we limit CPUShares of a process, or set the nice-value of a cgroup unit? When would we want to do one or the other?
sched(7)
: "Under group scheduling, a thread's nice value has an effect for scheduling decisions only relative to other threads in the same task group." A cgroup being such a task group. See my answer for more details. – Totor Mar 14 '19 at 13:28