Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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%?

Thank you.

share|improve this question
No this is not possible. With all due respect, the point of a system is to get used. Letting CPU cycles go to waste is utterly pointless. You might as well just downgrade your system if you plan on doing that. Just out of curiosity, what do you hope to gain? In other words, may I ask why you would want to do this? –  cksum Sep 14 '11 at 10:05
If I have a process that needs the CPU to do serious work, and this is busy with a browser I am not even using, it is not an optimal use of resources. And when running on batteries, having a process that keeps the CPU busy doing nothing is not good. –  Pietro Sep 14 '11 at 10:30
One might also be giving yourself "working room". For example, I have a process that will tie up my entire processor for the better part of an hour. I'd rather it take two hours but my computer be usable in that time. –  Fomite Sep 19 '11 at 21:22
@cksum this is possible. –  faraz May 5 '12 at 2:44

7 Answers 7

up vote 5 down vote accepted

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 `pidof ${app}`
        sudo /path/to/cputhrottle ${pid} ${limit}
share|improve this answer

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.

share|improve this answer
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

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.

share|improve this answer

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.


share|improve this answer

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

for f in $(pgrep Drive; pgrep Chrome); do renice -n +20 -p $f ; done
share|improve this answer

This script is based on Faraz's answer and is a pure bash script:


# Get the Process/App names from Activity Monitor and put them here
# Set the respect limits here

while true; do
    for app in ${apps}; do
        for limit in ${limits}; do
            for pid in `pidof ${app}`; do
                 sudo cputhrottle ${pid} ${limit} &

I also modified the sudoers configuration to allow execution of cputhrottle as root without having to enter the password everytime.

share|improve this answer
How does this differ from the original script? –  patrix 5 hours ago

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
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.