You are not logged in.
I tried
cpulimit -l 30 makepkgbut the cpu usage still reaches 100% + 100% due to conky (i have 2 core cpu). OK, I've found out that cpulimit does not restrict child processes but cgroup is promised to do that. So I installed it from AUR and did the following:
sudo systemctl enable cgconfig
sudo systemctl start cgconfig
sudo cgcreate -t my_name:my_name -a my_name:my_name -g memory,cpu:my_build
sudo echo 100000000 > /sys/fs/cgroup/memory/my_build/memory.limit_in_bytes
sudo echo 300 > /sys/fs/cgroup/cpu/my_build/cpu.shares
cgexec -g 'memory,cpu:my_build' makepkgBut cpu usage is nevertheless 100% + 100%.
Am I doing something wrong? And how to fix it?
Last edited by Next7 (2015-01-16 00:40:18)
Offline
Is it enough to make makepkg use 100% of one core and 0% of the other? If so, set MAKEFLAGS to use just one core.
Offline
Thanks for the reply and the tip, it will be a good compromise solution. But it would be nice to make cgroup to work and to decrease cpu usage below 50%.
Offline
I've found the solution for my problem. First of all "cpu.shares" parameter is useless for one task and one cgroup which is my case since it specifies a relative share of CPU among different cgroups.
So for my purpose the following parameters are needed: "cpu.cfs_period_us" and "cpu.cfs_quota_us". The execution of the following commands resulted in 10% + 10% CPU load.
echo 1000000 > /sys/fs/cgroup/cpu/my_build/cpu.cfs_period_us
echo 200000 > /sys/fs/cgroup/cpu/my_build/cpu.cfs_quota_usAnd there's another important point: "cgexec" command should be executed with option "--sticky" to restrict child processes.
cgexec -g memory,cpu:my_build --sticky makepkgOffline