Closed consideRatio closed 1 year ago
This apparently is deprecated and replaced with MemoryMax instead, which is supported since at least v243
MemoryMax=
has been around since at least v232.
Generally, with given minimum systemd version, I wouldn't worry about cgroupv1 and say the system has to be at least hybrid.
Two FIXME notes
There are two FIXME notes related to cgroups in systemdspawner.py:
https://github.com/jupyterhub/systemdspawner/blob/38875b4df8f91a36655f848439440fd31d549b98/systemdspawner/systemdspawner.py#L295-L305
Let's try resolve them!
Systemd's three modes
I figure we are not managing cgroups directly, but relying on systemd to do various things with cgroups when we use it to start system transient service units. It seems that there are three modes for systemd to run in:
To check if unified mode is used, we can check like this:
Systemd function based on mode
Systemd can't support all functions or do it the same way in all the modes, and there are some notes about various modes in systemd docs about resource control.
CPUAccounting
This seems supported no matter what mode systemd runs in.
CPUQuota
CPUQuota seems supported on when systemd running in either mode.
It seems to be implemented differently behind the scenes using cgroup v1's
cpu.cfs_quota_us
or cgroup v2'scpu.max
depending on.MemoryAccounting
Should be fine to use no matter what.
MemoryLimit
This apparently is deprecated and replaced with MemoryMax instead, which is supported since at least v243 so we should be fine to replace MemoryLimit with MemoryMax.
Reference