Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
A few tools to manage the CPU load of processes
Posted 10-12-2016 at 12:11 PM by the dsc
Sometimes I see questions related with that floating around, so here's a quick and lazy (just copying defitions from the manuals or sites of these programs) post on which hopefully someone in need of such tools will stumble as well.
"ionice - get/set program io scheduling class and priority"
"The auto nice daemon activates itself in certain intervals and renices jobs according to their priority and CPU usage. Jobs owned by root are left alone. Jobs are never increased in their priority."
"cpulimit is a simple program which attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when you don't want them to eat too much cpu. It does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly."
This is the lattest one I've found:
"loadwatch either spawns a child process prog with the arguments args and controls it with all its process group, or takes control of an already running process with pid pid with all its process group. Loadwatch allows the controlled processes to run while the load average remains below high_limit. Every delay seconds, loadwatch checks the load average. If the load is above high_limit, the child is suspended; the child is resumed when the load falls below low_limit."
Except for ionice, it seems they're all almost "hidden gems", not being as well known as they deserve (but I don't really have any accurate way to access that, just an impression based on nothing). I'm pretty much a fan of cpulimit, pretty good to tame heavy processes. "AND" is somewhat hard to fine-tune, but it's nice, no pun intended (a pun would perhaps be "it's all too nice"). Loadwatch seems specially interesting as it doesn't reduce the CPU load at a given limit by default, but can be used to make a process work more or less in the background without interfering with "foreground" processes if those are demanding "too much" CPU.
"ionice - get/set program io scheduling class and priority"
"The auto nice daemon activates itself in certain intervals and renices jobs according to their priority and CPU usage. Jobs owned by root are left alone. Jobs are never increased in their priority."
"cpulimit is a simple program which attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when you don't want them to eat too much cpu. It does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly."
This is the lattest one I've found:
"loadwatch either spawns a child process prog with the arguments args and controls it with all its process group, or takes control of an already running process with pid pid with all its process group. Loadwatch allows the controlled processes to run while the load average remains below high_limit. Every delay seconds, loadwatch checks the load average. If the load is above high_limit, the child is suspended; the child is resumed when the load falls below low_limit."
Except for ionice, it seems they're all almost "hidden gems", not being as well known as they deserve (but I don't really have any accurate way to access that, just an impression based on nothing). I'm pretty much a fan of cpulimit, pretty good to tame heavy processes. "AND" is somewhat hard to fine-tune, but it's nice, no pun intended (a pun would perhaps be "it's all too nice"). Loadwatch seems specially interesting as it doesn't reduce the CPU load at a given limit by default, but can be used to make a process work more or less in the background without interfering with "foreground" processes if those are demanding "too much" CPU.
Total Comments 0