HOWTO+-+Use+cgroups+to+limit+a+user+in+Linux

code apt-get install cgroup-bin

echo 'group memlimit20gb75percentCPU { cpu { # Default cpu shares is 1024 so 750 is roughly 75% (however this is relative to the rest of the configuration) cpu.shares = 750; }       memory { # Use up to 25 GB of memory memory.limit_in_bytes = 25G; # If 25 GB of memory exceeded, allow to use up to 20 GB more of SWAP memory.memsw.limit_in_bytes = 45G; } }' >> /etc/cgconfig.conf

echo 'userX          cpu,memory              memlimit20gb75percentCPU/' >> /etc/cgrules.conf code