Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Renice-ing a range of processes

Hi guys,

I'm not sure if it's the right place to post this thread, but another fellow user on a different part of the forum pointed me here, and since I'm on SL and my query deals with SL processes...

I already know how to renice one or two processes in Terminal, but I'd like to learn how to renice a range or group of processes, for example processes 1 through 200 (it's just an example), leaving root process 0 out of the equation. What I lack is the proper syntax to enter that command in Terminal. I've tried with a dash, a lower dash, parentheses, etc... and got an error message.

What's the proper syntax to achieve my goal?

MacBook Pro 2006, Mac OS X (10.6.5), 2GB RAM - Longing for a 17" MacBook Pro with the i5 chip...

Posted on Nov 12, 2010 1:53 AM

Reply
10 replies

Nov 12, 2010 7:51 AM in response to OneCatFamily

You are not under clocking anything. You are just changing which process gets access to the CPU ahead of each other. But if the CPU is not busy with another process the lowest priority process can use every ounce of the CPU and Mac resources that it desires.

You could always just tell 'renice' to throw away the error messages, and then renice processes that do not exist

renice +1 -p $pid >/dev/null 2>&1

If you want to target just real processes, then you would do something with the 'ps' command

for pid in $(ps -aex -opid)
do
[[ $pid == 0 ]] && continue
renice +1 -p $pid
done

Nov 12, 2010 12:06 PM in response to OneCatFamily

OK, but where do you type this? In Terminal? Is it possible to write an AppleScript that would take care of it from startup on?

Yes 🙂

You can type it into a terminal session (or copy & paste)

You can put it in a shell script.

You can put this in an Automator "Run Shell Script" action.

You can write an Applescript.

But why? All this will do is make existing apps and daemons get in the back of the line for access to the CPU. New processes will have a higher priority.

Also all existing processes will no run faster or slower or use less CPU with respect to each other.

So what do you expect to accomplish?

Nov 13, 2010 1:08 AM in response to BobHarris

[quote]So what do you expect to accomplish?[/quote]

Well, that's the rub, isn't it? First of, I must tell you that my MacBook Pro is four years old, and has had overheating issues from the get-go. I've (partly) disassembled it once or twice, and I know that in order to solve said issues, I'd have to remove a big part of the thermal grease that the manufacturer so generously applied on both the CPU cores and the GPU, because strangely enough, instead of dissipating the heat, it seems to concentrate it in one or two focal points, hence the overheating, and I'm too busy/lazy to remove the big gobs that stick up from the CPUs and GPU. Add to that the fact that it took me several weeks (!!!) after first use to notice my fans weren't working at all, and you'll understand my predicament... I've sent this MBP for repair twice: the first time because my logic board was toast (literally), and the second time for a SuperDrive problem. Both times, repair was made under warranty, so I didn't have to pay a dime.

Now back to your legitimate question: I've been foolish enough to think that putting a lower priority on some demanding processes would solve my overheating issues, since the CPU cores would be working less hard, thus dissipating less heat. I've even been to the trouble of removing the small aluminum-like plastic plate covering the RAM modules; it seems to have a positive effect on the overheating (my CPU cores seldom go higher than 70°C now, instead of an all-too-frequent 90°C before removing the plate), maybe by creating a small draft of air around the CPU and GPU. On iddle, the temp stays in the low 50s Celsius, which is fine by me, I guess.

So, in a nutshell, and aside from using a PPC app called Process Wizard, which essentially does what I've already done in Terminal, ie set a lower priority on some processes, only doing it via a simple but effective GUI, I'm stuck. I thought Snow Leopard would manage RAM and CPU usage a little better than Tiger did, but it seems I've been mistaken on that too...

Message was edited by: OneCatFamily

Nov 13, 2010 2:22 AM in response to OneCatFamily

... And to add insult to injury, I haven't been able to install a mere iTunes update, because my MBP shut itself down after repeatedly hitting 120°C during inscription of the new components, even though I'd reniced all demanding processes (install daemon went overboard at 190%).

So my question now is, what can I do to prevent this from happening again and again? And don't tell me to buy a new Mac and ditch this one: even if I had the money, I'm not sure I'd invest in a new Mac anyway; too much disappointment, I guess... My girlfriend bought herself an Acer laptop (cost her all of 690 euros) with a 14" screen, 4GB of RAM and a 500GB hard drive. She's a power-user, same as me, but she doesn't seem to have any trouble at all with her machine; meanwhile, I, sitting right next to her with my MBP on my lap, can be heard ******** about this and that.

Er, by the way, I'm posting this from my other machine (a somewhat aging and sturdy Toshiba laptop running Windows Seven), waiting for my vintage MacBook Pro to cool down...

Nov 13, 2010 4:26 AM in response to OneCatFamily

Renice'ing changes the order that processes stand in line waiting for the CPU. It does not change the overall CPU usage. And if no other process wants to use the CPU, the lowest priority process can have all the CPU time it wants.

Assuming your fans work again, there is a utility that can control there speed so you can keep you normal temp lower, and when burst demands are put on your CPU it will take longer to reach higher temps.

You could get a cooling pad to blow air on the bottom of the laptop.

The disk drive is a major source of internal heat, so is you are doing a lot of paging/swapping, adding more memory may reduce this.

Or replacing the disk, with a solid state disk, will cut out a lot of heat.

Other, as I'm not a hardware expert. You might try asking about cooling issues in the MacBook Pro hardware related forum.

However, renice is not the solution.

Nov 14, 2010 9:55 PM in response to BobHarris

I followed your advice and decided to try a new tack; it's not free, but so far, it's extremely gratifying: I've downloaded (and bought...) a copy of a small app called CoolBook (here: http://www.coolbook.se/CoolBook.html), I've installed it, and so far, so good. CoolBook acts at kernel level to undervolt the CPUs, allowing to run full blast only when really needed, and you can put a cap to the operating temperature, so that even when both cores are hard at work, your logic board temp never goes through the roof.

As an example, I installed Windows XP Pro on a virtual machine with VirtualBox, an operation that would normally send my MBP's fans in a craze. Here, the temperature NEVER exceeded 60°C, even at the height of install, when both the CD drive and virtual drive were reading/writing. My MBP never feels sluggish or slow in any way, and so far, I've had no application crash to deplore... I think we got a winner!

Thanks to all you guys for taking the time to read my rantings and try to soothe my mind! I've learned a lot of interesting things in this thread, one of them being that you can't rollerskate in a buffalo herd... 😉

Renice-ing a range of processes

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.