NFS (60%) Other (20%) WWW (20%) Example (from the Kernel docs) System (30%) Professors (50%) Students (20%) System (30%) Professors (50%) Students (20%) P (15%) S (5%) 1. Introduction @vpetersson
a group $ cd /sys/fs/cgroup $ mkdir -p cpuset/group1 # Limit ‘group1’ to core 0 and enroll the current shell $ echo 0 > cpuset/group1/cpuset.cpus $ echo $$ > cpuset/group1/tasks 2.1 CPU Resources @vpetersson
/sys/fs/cgroup $ mkdir -p memory/group1 # Set a memory limit of 150M $ echo 150M > memory/group1/memory.limit_in_bytes # Add shell to group $ echo $$ > memory/group1/tasks # Fire off a memory eating task $ ./memhog 2.1 Memory Resources @vpetersson
CPU shares (relative weight) --cpuset="" CPUs in which to allow execution (0-3, 0,1) -m, --memory="" Memory limit (format: <number><optional unit>, where unit = b, k, m or g) --memory-swap="" Total memory usage (memory + swap), set '-1' to disable swap (format: <number><optional unit>, where unit = b, k, m or g) @vpetersson