I have a process doing some computation the whole time. It causes my system's CPU to heat up and the fan to spin faster.
I want this process to run, but with a low priority. I don't want my system to heat up and my fan to spin because of it. Is it possible to achieve this?
If it matters, my CPU is an AMD Ryzen 5 3500U and the process is a browser tab (I'm running it in Chromium, but am happy to change browser if it helps). I'm willing to even run the whole browser inside a VM if it helps.
What I tried and why it failed:
The best solution found so far is limiting the maximum CPU frequency:
echo 0 > /sys/devices/system/cpu/cpufreq/boost cpupower frequency-set -u 1200MHz
It works, but it means that other processes are affected too: compiling, (un)compressing etc takes way longer.
Moreover, the CPU is still warmer than if the process wasn't running. Although to acceptable temperatures.cpulimit cripples the performance of the target process.
If I set the percentage of CPU allowed to 50% (cpulimit -l 50 -p ...
), the computation becomes a lot slower than normal (like 10x as slow; I don't have a good way to measure the accurate slowdown).I played around with cgroups for a bit, but couldn't get any effect.
Nice has no effect of course.
Is there anything else I should try?
cpulimit -l 50
is slowing the proces way way more than the 50% I request. – peoro Aug 19 '20 at 07:37cpulimit -L 400
which should more or less limit the process to 50% of cpu capacity (try playing with the number if not satisfied) – stoney Aug 19 '20 at 07:39cpulimit -l 100
. – peoro Aug 19 '20 at 07:42cpulimit
to limit the amount of cpu used. Might or might not help. – stoney Aug 19 '20 at 07:48