There used to be a kernel config option called sched_user or similar under cgroups. This allowed (to my knowledge) all users to fairly share system resources. In 2.6.35 it is not available. Is there a way I can configure my system to automatically share io/cpu/memory resources between all users (including root?). I have never set up a cgroup before, is there a good tutorial for doing so? Thank you very much.
The kernel documentation provides a general coverage of cgroups with examples.
Configuration is done by editing the following two files:
Used by libcgroup to define control groups, their parameters and mount points.
Used by libcgroup to define the control groups to which the process belongs to.
Those configuration files already have examples in it, so try adjusting them to your requirements. The man pages cover their configuration quite well.
Afterwards, start the workload manager and rules daemon:
The workload manager (cgconfig) is responsible for allocating the ressources.
Adding a already running process to the manager:
Or automatically over the cgrules.conf file and the CGroup Rules Daemon (cgred), which forces every newly spawned process into the specified group.
Example /etc/cgconfig.conf :
Example /etc/cgrules.conf :
This will share the CPU ressources about 50-50 between the user 'alice' and 'bob'