OS X: throttle application CPU utilization #
- For process IDs that remain constant, check out Will Nolan's open source cputhrottle, "a small OS X command-line utility designed to limit the CPU usage of a process to which it attaches."
# cputhrottle pid %CPU
- GUI options:
- Jean-David Gadina's ProcessRenicer - Activity Monitor on steroids
- fuyu's AppPolice - menu bar app that can quickly limit CPU usage of any running process
- To specify a process name instead of an ID (as when a PID for a given process keeps changing), cpulimit might work, but it caused a kernel panic on my machine running 10.6.7. Another option is to loop Aidan Findlater's renice oneliner from a root prompt:
$ sudo su -
# while true; do renice +15 -p `ps ax | grep processname | grep -v grep | awk '{print $1}' | tr 'n' ' '`; done
- UPDATE: St. Clair Software's App Tamer 2.7.2 does the job of reining in errant apps admirably, and is compatible with OS X/macOS versions from 10.9 all the way to 12.4 (they also considerately still offer version 1.3.2 for OS X 10.5 - 10.7).
Windows users will appreciate Claus' Windows CPU throttling techniques.
/mac | Jul 23, 2011
Subscribe or visit the archives.