3

So I'm in the process of setting up CGroups on a few servers, and I'm using the documentation pretty heavily to do this.

I came across this in section 2.8.1 of the Fedora Resource Management Guide (also weirdly in This redhat guide:

The entry now specifies that when the user named maria uses the ftp command, the process is automatically moved to the /usergroup/staff/ftp cgroup in the hierarchy that contains the devices subsystem. Note, however, that the daemon moves the process to the cgroup only after the appropriate condition is fulfilled. Therefore, the ftp process might run for a short time in the wrong group. Furthermore, if the process quickly spawns children while in the wrong group, these children might not be moved.

This is listed as somewhat of a sidenote, but it seems like a pretty major issue that kind of undermines the whole point of cGroups. So before I go any further in setting these up, is there a work around or fix for this? Or am I not approaching this right in my thought process?

Its suggested to use cgexec like this to launch a process in a cgroup:

cgexec -g cpu:group1 lynx http://www.redhat.com

but that seems like it would be kind of hard to implement system wide so that every process was launched like so.

Am I missing something here or is there really no alternative? It also seems like this could be a documentation bug as the fedora guide is using a redhat.com link as the example which makes me think the doc is outdated.

Cheers!

Rooster
  • 485
  • 2
  • 7
  • 21

1 Answers1

2

on redhat I used libcgroup-pam to move user processes to cgroup, libcgroup-pam does work for me because it sets the users session process to the cgroup, and then all other processes are children and are defaultly in the cgroups

c4f4t0r
  • 5,149
  • 3
  • 28
  • 41
  • how would that stop the bug I described from occuring? It seems like it goes the route of making the parent process(login) have the cgroup id, but what if the login process spawns others too quickly as described above? – Rooster Jan 03 '14 at 15:40
  • did you search in bugzilla for any known bug? – c4f4t0r Jan 03 '14 at 20:47
  • dont see anything relevant. – Rooster Jan 03 '14 at 21:12
  • 2
    Actually, upon further research/testing, libcgroup-pam does work for me because it sets the users session process to the cgroup, and then all other processes are children and are defaultly in the cgroups. You should expand your answer. – Rooster Jan 09 '14 at 23:49