Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > YARSC (yeat another renice shell script)

YARSC (yeat another renice shell script)
Thread Tools
Forum Regular
Join Date: Jan 2002
Status: Offline
Reply With Quote
Jul 31, 2003, 08:38 PM
 
Hi there

After having seen many speed boost scripts in such sites as MacOSX Hints or MacNN, i decided to give a little try to a final script which would do the job my way.

This script (YARSC) should match the following concerns:

1.renice the user account, but not too much (-5 to -10)

2.renice the root processes to +5 to +10

3.renice individual processes, both user and root, like Finder, Dock, Window Manager (user) or coreservicesd, mDNSResponder (root).
(These were choosed after a long observation with the top command in Terminal: these processes are the ones which fill more CPU and memory usage)

4.write a script to set these priorities at login startup

5.the last command is used to free RAM back to start, so the script uses no RAM at all.

I finally decided to use Applescript and the "do shell" command to manipulate everything.

Once the script is ready, compile it as an app, put it in your login startup items, and restart.

Here is finally the YARSC version i think works the best (after many many tries):

USERNAME= your actual username
PASSWORD= your admin password

---begin---
do shell script "sudo renice -10 -u USERNAME" password "PASSWORD" with administrator privileges

do shell script "sudo renice +5 -u root" password "PASSWORD" with administrator privileges

set dnsPID to do shell script "ps -axww | grep '[/]mDNSResponder'| awk '{print $1}'"
do shell script "sudo renice -10 -p " & dnsPID password "PASSWORD" with administrator privileges

set corePID to do shell script "ps -axww | grep '[/]coreservicesd'| awk '{print $1}'"
do shell script "sudo renice -10 -p " & corePID password "PASSWORD" with administrator privileges

set finderPID to do shell script "ps -axww | grep '[/]Finder'| awk '{print $1}'"
do shell script "sudo renice -15 -p " & finderPID password "PASSWORD" with administrator privileges

set dockPID to do shell script "ps -axww | grep '[/]Dock'| awk '{print $1}'"
do shell script "sudo renice -15 -p " & dockPID password "PASSWORD" with administrator privileges


set littlePID to do shell script "ps -axww | grep '[/]LittleSnitchDaem'| awk '{print $1}'"
do shell script "sudo renice -5 -p " & littlePID password "PASSWORD" with administrator privileges

set logitechPID to do shell script "ps -axww | grep '[/]LCCDaemon'| awk '{print $1}'"
do shell script "sudo renice -5 -p " & logitechPID password "PASSWORD" with administrator privileges


set ouiPID to do shell script "ps -axww | grep '[/]SystemUIServer'| awk '{print $1}'"
do shell script "sudo renice -15 -p " & ouiPID password "PASSWORD" with administrator privileges


set pbsPID to do shell script "ps -axww | grep '[/]pbs'| awk '{print $1}'"
do shell script "sudo renice +15 -p " & pbsPID password "PASSWORD" with administrator privileges

set atsPID to do shell script "ps -axww | grep '[/]ATSServer'| awk '{print $1}'"
do shell script "sudo renice +15 -p " & atsPID password "PASSWORD" with administrator privileges

do shell script "sudo du -sx /" password "PASSWORD" with administrator privileges
---end---

Some observations:

1.At login, the script takes about 30 sec to run

2.Once the script applied, all the benchmarks i did show my Mac seems to have a speed boost about 30% in any operation, but Internet connections are the most increased

3.The original script is from Carl Bond (http://www.carlbond.com/howto.html), specially all the shell script syntax

4.If you want to speed up the script at login, you can convert it to a full app, with a great freeware called "Platypus" (http://www.raunvis.hi.is/~ssv/software.html). You can also delete the last command of the script, which takes about 15 sec by itself

5.All these results only make sense applied to my own machine (G3 500, 384Mb RAM, X.2.6). Don't know if it would make a dfifference with a G4 Bipro

6.Try it, use it, change it. You have nothing to loose (except your precious time)...

Say something

Vic
(Last edited by Prijker; Jul 31, 2003 at 08:47 PM. )
     
Prijker  (op)
Forum Regular
Join Date: Jan 2002
Status: Offline
Reply With Quote
Aug 4, 2003, 05:34 AM
 
is everybody out on holidays?

vic
     
Professional Poster
Join Date: Nov 2000
Location: Norway (I eat whales)
Status: Offline
Reply With Quote
Aug 4, 2003, 05:45 AM
 
LoL! But it's safe right? I might give it a go.

Sniffer gone old-school sig
     
Professional Poster
Join Date: Nov 2000
Location: Norway (I eat whales)
Status: Offline
Reply With Quote
Aug 4, 2003, 06:55 AM
 
The script is now on place. I made an application trough the save dialog in AppleScript. Seems to work nice. Hard to tell any difference right now, but according to Process Wizard priorities for the various apps have been changed a lot. Is the result affected by if you run this script on startup or in the middle of a session as I did now? Thanks.

Sniffer gone old-school sig
     
Professional Poster
Join Date: Nov 2000
Location: Norway (I eat whales)
Status: Offline
Reply With Quote
Aug 4, 2003, 12:00 PM
 
This script actually did make my system more responsible. Pretty neat. Thanks Prijker.

Sniffer gone old-school sig
     
Grizzled Veteran
Join Date: May 2001
Location: Ca
Status: Offline
Reply With Quote
Aug 4, 2003, 01:23 PM
 
Originally posted by Prijker:
is everybody out on holidays?

vic

whats going on! sound neat can you explain more on how to do it.
real
With some loud music + a friend to chat nearby you can get alot done. - but jezz, I'd avoid it if I had the choice---- If only real people came with Alpha Channels.......:)
AIM:xflaer
deinterlaced.com
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Aug 4, 2003, 01:32 PM
 
Originally posted by Prijker:
is everybody out on holidays?

vic
Na, we're just trying to figure out where the "C" in your acronym came from.
     
Professional Poster
Join Date: Nov 2000
Location: Norway (I eat whales)
Status: Offline
Reply With Quote
Aug 4, 2003, 05:23 PM
 
[edit]never mind[/edit]
(Last edited by sniffer; Aug 5, 2003 at 03:05 PM. )

Sniffer gone old-school sig
     
Prijker  (op)
Forum Regular
Join Date: Jan 2002
Status: Offline
Reply With Quote
Aug 4, 2003, 06:47 PM
 
Originally posted by Xeo:
Na, we're just trying to figure out where the "C" in your acronym came from.
sorry
should be YARSS acronym

Anyway, it works good

vic
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:27 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2