setting resource limits per user with cgroups v2 enabled

jaimin bhaduri jaimin at webuzo.com
Thu Apr 27 05:25:00 UTC 2023


I set cpuquota, memorymax, memoryhigh, tasksmax, etc in
/etc/systemd/system/user-1000.slice.d/override.conf file so that user's
processes follow these resource limits. But these limits get enforced on
user's processes started from user's terminal only but not from root's
terminal doing su [user] or processes started from php scripts that run
after stepping down as the user through cron.
I understand that to set resource limits of a cgroup on a process, the
process has to be moved to the cgroup.
So is there a way to automatically detect when a user's process starts,
execute a bash script to fetch its pid and move it to the cgroup?
I am looking for some external daemon which can do this easily? Or do I
have to make .service and .sh files? What do you guys suggest?
I want to do this for multiple users in debian 11, almalinux 9 and ubuntu
22?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20230427/6add0f1e/attachment.htm>


More information about the dbus mailing list