I would like to avoid a process using too much CPU. In fact, I want to prevent my CPU from heating up since I have some really long CPU demanding tasks (video converting) to run from a Raspberry Pi with Debian on it: temperature rises over 80 °C.
I have seen that there's a cpulimit
command, but I don't know how to run my command with it since it seems to take either the pid (process ID) as argument or an executable file with the code to run, not the bash command itself. I would like to directly see what my task returns and be able to Ctrl-C if needed. Note: if I try to put my task command into a file and run cpulimit -l 20 --path=/path/to/my/file.sh
, then it returns Warning: no target process found. Waiting for it...
So it looks like I am unable to understand 1) what the --path argument actually does, and 2) how to properly use cpulimit on any terminal command...
I would prefer not to use workarounds like nohup my-command --my-args &
, even if it secondarily returns the pid and let me write the cpulimit command for it.
Thanks in advance!
nice
be enough? – Rui F Ribeiro Feb 27 '18 at 20:18nice
my task would use all the CPU even with the worst priority since there won't be other tasks in the same time. – Johannes Lemonde Feb 27 '18 at 20:29