I have a Debian 10 server and I am trying to limit the memory + swap of a user using cgroups2.
Using memory.limit_in_bytes works fine, but I want to limit the memory+swap using memory.memsw.limit_in_bytes which isn't working.
I get this error when I run cgconfigparser:
root@server:~# cgconfigparser -l /etc/cgconfig.conf
Error: failed to set /sys/fs/cgroup/memory/group1/memory.memsw.limit_in_bytes: Invalid argument
cgconfigparser; error loading /etc/cgconfig.conf: Failed to remove a non-empty group
root@server:~#
Here is the group:
group group1 {
memory {
memory.memsw.limit_in_bytes = 512m;
}
}
Any idea on what's wrong?
EDIT: I've enabled cgroups memory and swapaccount in the GRUB command already but still the issue occurs.