[SOLVED] separate resource limit for each child process using cgroup
Linux - ContainersThis forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
separate resource limit for each child process using cgroup
Hi,
I am new to cgroups, so bit struggling to get something done.
I have a systemd service which when started, runs a particular process as daemon in the background.
The daemon then forks several child processes.
I want to set an upper limit to memory and cpu of each child process, say 1G.
What I understand here is that the systemd service, daemon and child processes are also part of same parent cgroup and thus memory/cpu limit assigned to parent cgroup (systemd services cgroup) will get divided between child processes that are forked.
The requirement is that each child process should get 1G memory each and some amount of cpu and it should not be that each child process should compete with other child processes to get a share of resources assigned to parent cgroup.
If for instance I set MemoryLimit to 50G for parent cgroup, but there are 100 child processes that are forked, each child won't get 1G memory.
So basically I cant set a MemoryLimit on parent cgroup, since I am not sure how many child processes will get forked
Creating a cgroup for each child process with above limits, may not be a good idea I guess.
I see this thread "over here" being marked [SOLVED] but without yet being solved "over there." (I posted a suggestion over there which is not a solution.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.