0

I'm trying to limit resource usage for a cgroup without having root access.

I can set memory.limit_in_bytes using cgm setvalue memory memory.limit_in_bytes 150G

But I can not set memsw.limit_in_bytes in the same way, regardless of whether memsw.limit_in_bytes is greater than memory.limit_in_bytes (This is necessary, because the memsw option sets maximum memory + swap limit)

All I receive is: Error org.freedesktop.DBus.Error.InvalidArgs: invalid request

Any ideas?

trevore
  • 149

1 Answers1

0

When using cgm, beware that cgm chown $controller $cgroup $uid $gid only changes the owner of the /sys/fs/cgroup/$controller/$cgroup directory and its cgroup.procs and tasks files. Unprivileged users who cannot write to those files will get an call to cgmanager_set_value_sync failed: invalid request message as you found out.

Another possibility is that the file is missing, for example due to missing swap support in the kernel. If your kernel is not configured with CONFIG_MEMCG_SWAP_ENABLED, then you have to pass the swapaccount=1 cmdline option.

Lekensteyn
  • 20,830