I would like to limit the amount of CPU time dedicated to certain processes (e.g. Firefox, Safari, ...).

I can't understand why such programs, even when not used (nothing loading, no animations, running in the background, ...), are so resource hungry. Why a browser must eat 50% or more of my CPU? Can I limit it to 10%?

11 Answers 11


Its not exactly what you wanted, but, in regards of google drive and chrome this what did the trick for me:

Google Drive ("Backup and Sync")

  • de-prioritize:

    for f in $(pgrep 'Backup and Sync'; pgrep 'FinderSyncAPIExtension'); do renice +20 -p $f; done
  • set back to normal:

    for f in $(pgrep 'Backup and Sync'; pgrep 'FinderSyncAPIExtension'); do renice 0 -p $f; done


  • de-prioritize all current processes:

    for f in $(pgrep 'Chrome'); do renice +20 -p $f; done
  • set back to normal all current processes:

    for f in $(pgrep 'Chrome'); do renice 0 -p $f; done

cputhrottle is the tool you need. You can install it with Homebrew.

You can monitor a series of processes by name by running the Bash script below. I'm not quite sure how to turn this into a login item since cputhrottle requires superuser permissions. Run it as a script, in an Automator workflow, whatever:

# Get the Process/App names from Activity Monitor and put them here
apps=("AppOne" "AppTwo" "AppThree")
# Set the respective limits here
limits={30 40 50)

while true; do
  for app in ${apps}; do
    for limit in ${limits}; do
      for pid in $(pgrep ${app}); do
        sudo /path/to/cputhrottle ${pid} ${limit}


I've added a different version for this script (a bash script), which might be useful for people looking for limiting the CPU for multiple applications.

This new script also allows you to specify a list containing the application name and the CPU limit for it.

The main difference is that you can add cpu limit per application, and it will run only once per application. I've also added the option for killing all cputhrottle processes.

The script assumes that both cputhrottle and pidof are installed before running it.


if [[ $EUID > 0 ]]; then
  echo "Please run this script as root/sudo"
  exit 1

# Pass --kill as argument to kill all running cputhrottles
if [ $1 = "--kill" ]; then  
  echo "Looking for running cputhrottles..."
  pids=`pidof cputhrottle`
  for pid in ${pids}; do
    echo "> Killing PID ${pid}"
    sudo kill ${pid}
  echo "Done!"
  exit 0

declare -a applications

# Syntax='application;max-cpu'

for i in "${applications[@]}"; do
  app=(${i//;/ })

  printf "\nLooking for ${app_name}...\n"
  pids=`pidof ${app}`
  for pid in ${pids}; do
    echo "> PID=${pid}, CPU=${cpu_limit}"
    sudo cputhrottle ${pid} ${cpu_limit} &

printf "\nDone!\n"
echo "Run this script passing '--kill' as argument to remove all cputhrottles."


  • 3
    As pointed out in another comment, cputhrottle's forumula was removed from Homebrew on Feb 17, 2019 because it doesn't work anymore. Yosemite was the last version of macOS to support cputhrottle. – Casimir Mar 23 '19 at 11:16
  • @Casimir and now, what to do? – Peter Samokhin Sep 16 '19 at 15:35
  • @PeterSamokhin Sorry, I don’t know of an alternative. But I also haven’t searched recently. – Casimir Sep 16 '19 at 16:53

You can indeed! There's CPUThrottle, which allows to specify a PID to restrict.

Note, they're trying to use that much for a reason, it's a useful tool but whether it'll make it better or worse for you on a day to day will be something you discover.

  • 1
    Interesting. But with this utility I have to launch a program, find its PID(s) and manually use cputhrottle. Every time I launch it. Is there something that allows me to tell the system: “From today always run this program with a maximum of 25% CPU” ? – Pietro Sep 14 '11 at 10:45
  • As far as I'm aware no, I've only ever come across CPUThrottle. – Nicholas Smith Sep 14 '11 at 11:03
  • 404 File not found – André Levy Jul 31 '19 at 0:47

Although not a direct answer to the OP's question, if you're having an issue with a particular process taking up too much of your CPU time, and making your computer unusable, and you don't mind how long that process takes to finish the task it's working on, you can use the renice to alter the priority of that process, making it behave nicely (hence the name).

First, you need to find the PID of the process that's using up the CPU resources. You can either do that in Activity Monitor, or in Terminal.app with the ps command - e.g. to find the PID of the Safari browser, type:

MacBook:~😈  ps -ef | grep Safari
  501 17452   263   0 11:36pm ??         4:15.60 /Applications/Safari.app/Contents/MacOS/Safari

The second line above is the output, and the PID is 17452 in this particular case.

Then, the next task is to change the priority of the process (let's say it's Safari we want to make behave nicely). To do this, in Terminal.app type:

MacBook:~😈  renice -n 10 -p 17452

The -n option changes the nice level by adding 10 to the current value (0 by default). The range of values are -20 to 20, with lowest value meaning highest priority. As an ordinary user, you can use values 0 to 20. To assign a negative value, you need to have root privileges (e.g. use sudo command). Read more about nice and renice by typing man nice and man renice in Terminal.app.

nice and renice don't limit the percentage of the CPU available to a given application per se, they do however allow to change the scheduling priority, or in other words how much of the CPU time a process will get. This is all relative to the CPU load on your system, so if the system is under utilised, you most likely won't see any difference.

  • Is there a way to see the current priority of a process? – theonlygusti Oct 23 '17 at 21:07
  • use top or htop to view the current nice value of a process. (brew install htop), (sudo apt install htop). You'll see one of the columns containing the value. – Tmanok Dec 19 '18 at 5:22

There is a simple one-liner for doing all that:

ps axu | grep Chromium | grep -v grep | awk '{print $2}' | sudo xargs -n 1 -I'{}' sh -c 'cputhrottle {} 10 &'

Write your app name instead of Chromium and desired percentage instead of 10 and you're good to go!

  • This worked well, though it can be reduced to: pgrep Dropbox | sudo xargs -n 1 -I'{}' sh -c 'cputhrottle {} 10 &'. I'm not sure if macOS comes with pgrep installed, however. – bigsweater Oct 1 '18 at 21:19
  • cputhrottle no longer works on 10.14 Mojave – John Pang Dec 15 '19 at 23:47
  • cputhrottle works on 10.15 so if it wasn't working on Mojave, it might be now. – TJ Luoma Jan 4 at 3:01

This is based off a previous answer, but adding the trap for ctrl+c to make sure the process being throttled gets left in a continue state, and adding set -e so this script will exit cleanly if the process itself exits:

trap ctrl_c_fn INT

function ctrl_c_fn() {
    echo "caught CTRL-C, exiting"
    kill -SIGCONT $pid

echo "enter process id"
read pid
echo "press Ctrl-C to exit"

set -e

while true; do
    kill -SIGSTOP $pid
    sleep 0.009
    kill -SIGCONT $pid
    sleep 0.001

The link that Nicholas Smith posted doesn't work anymore. So I found one other app that does the trick for the people who are searching it again. the app calls Apppolice.


  • 2
    Similar to AppPolice, there is AppTamer (stclairsw.com/AppTamer). One word of caution: as of me writing this comment, AppTamer has yet to be OSX Sierra compatible. – John Mark Mitchell Oct 21 '16 at 15:48
  • Oh my, what a find. Just installed AppTamer. Pleased to report works fantastically well. I use it to keep the new StarCraft remastered in line when I alt-tab out. Oh and I forgot to mention, I'm running macOS Sierra 10.12.6. Thanks for the suggestion! – cavalcade Aug 23 '17 at 15:23
  • Apppolice has been discontinued. – LаngLаngС Sep 27 '17 at 16:48
  • But still works quite fine. – phil pirozhkov Jul 2 '19 at 14:13
  • I can confirm AppPolice works on 10.15.1 – Rho Phi Nov 28 '19 at 11:34

this sh worked for me

echo "enter process id"
read pid
echo "press Ctrl-C to exit"

while true; do
    kill -SIGSTOP $pid
    sleep 0.009
    kill -SIGCONT $pid
    sleep 0.001

This is my final script, keep clean the command cputhrottle only execute new one if doesn't exist


# setup cputhrottle if doesn't exists
    service_pid=$(pgrep $1)
    if [[ ! -z $service_pid  ]]; then
        service_cpu=$(ps aux | grep "sudo cputhrottle $service_pid $limit" | grep -v grep | wc -l)
        if [[ ! $service_cpu -gt 0 ]]; then
            sudo cputhrottle $service_pid $limit &

# main loop
while true; do
    set_service_cpu_limit bzfilelist 2
    set_service_cpu_limit bztransmit 2
    sleep 0.5

The script Dimitri wrote does work well (on macOS), but it keeps running with errors after the application is closed. I changed it to make it finish (with an error message about PID not found):

echo "enter process id"
read pid
echo "press Ctrl-C to exit"

while kill -SIGSTOP $pid; do
    sleep 0.009
    kill -SIGCONT $pid
    sleep 0.001
  • This should probably be an edit made to Dimitri's original answer, in order to improve that answer, and not a separate answer with (basically) the same info. – fsb Aug 4 '18 at 14:34

I use AppPolice. It is a bit unstable and clunky but since there are no other options and the problems are minor I think it is a decent solution. Works on Catalina.

  • Except there are other options, such as AppTamer which is actually still under development. – TJ Luoma Jan 4 at 2:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .