LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This 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


Reply
  Search this Thread
Old 02-24-2022, 06:32 AM   #1
joemon83
Member
 
Registered: Jan 2009
Posts: 71

Rep: Reputation: 11
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.

Last edited by joemon83; 02-24-2022 at 06:40 AM.
 
Old 02-24-2022, 11:22 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
This has been duplicated under "Server". Removing from zero-post bump.

Would have been better to request a move of this by the mods.
 
Old 02-28-2022, 10:57 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
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.)
 
Old 03-01-2022, 03:25 AM   #4
joemon83
Member
 
Registered: Jan 2009
Posts: 71

Original Poster
Rep: Reputation: 11
I wish there was an option to delete a post or move it to another section.
 
Old 03-02-2022, 04:41 PM   #5
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554
Quote:
Originally Posted by joemon83 View Post
I wish there was an option to delete a post or move it to another section.
As per post #2, moderators can move threads - next time you can use the "report" button to request this.


Last edited by boughtonp; 03-02-2022 at 04:43 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to limit the read cache per process/cgroup? bodqhrohro Debian 1 01-29-2022 11:56 PM
[SOLVED] Pacemaker Resource showing as "unrunnable start (blocked)" for each cluster resource tooreply Linux - Server 1 05-12-2020 10:55 AM
Under which circumstances a child process creates another child process using fork? mitsulas Programming 3 12-08-2009 08:16 AM
Killing a child process from another child marri Programming 6 10-01-2004 07:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 12:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration