The programme cpulimit
on Linux is great. You can tell it to limit a process so that it doesn't use more than X% of the CPU. For example, I know someone who's laptop overheats if the CPU runs too hot for too long. When doing some video encoding, they use cpulimit to prevent the CPU being fully used, and hence overheating. You can't use nice
to stop that.
Is there something like that for the load?
Ideally I'd like to be able to do loadlimit 4 my-command-here
and it will start my-command-here
and every X sec loadlimit
will check the (1 minute) load of the machine, and if it's above 4, then my-command-here
will be paused. When the load goes below 4, the command will be paused. This is exactly what cpulimit
does BTW.
Does such a tool exist?