17

I'm wondering, is there way to tell a process how much processor power it can take?

The problem is I'm converting video with Arista (video converter) and I'm annoyed by the fan running like crazy, when I look at the task monitor, it's taking over 92% of CPU.

Can I (somehow) tell it that it can take just 20%?

Thanks

Paulo Tomé
  • 3,754
  • 6
  • 26
  • 38
equivalent8
  • 293
  • 2
  • 8

3 Answers3

21

There is cpulimit tool (also is present in debian repo and should be in other distros).

It's usage is pretty simple:

cpulimit -p PID -l MAX_CPU_LEVEL

You can also use process name, or full path to binary. Details you can find on the man page.

rush
  • 27,055
  • 7
  • 87
  • 112
8

Another way is by using the (relatively) new kernel interface called cgroups (wikipedia article here). It allows more fine grained control of how much cpu/memory/io/etc a process/user/group is allowed to consume.

Tommy
  • 521
  • 2
  • 4
0

While this may not be exactly what you are looking for, you can use the renice program to change the program priority to prevent it from slowing down other applications on the system. renice -n 20 -p [pid], where [pid] is replaced with the process ID of Arista would likely lower its' resource usage, and would definitely decrease system slowdown.

re-cursion
  • 451
  • 2
  • 6
  • 1
    The OP is not complaining about the process slowing down other applications but about the fan running like crazy, `renice` can't do anything against the latter. At best it will slow down the video converter but the competing processes (if any) will maintain the CPU load as before. – jlliagre Sep 07 '15 at 19:35