Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'I just script out my own answer' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
I just script out my own answer
Authored by: imag0 on Dec 09, '02 09:35:52PM
Nice thing about X is that you can script out your own renicer. I use this on my iBook and it seems to work pretty well:

top -u -l 1 | head -20 | tail -12 | grep -v kernel | awk ' { print $1 } ' | xargs -n1 renice -10

Basically, it greps out the top 12 or so processes and renices them to -10. You can tweak the setup to your liking but don't push up the renice past -19.

You can set this script to be run every (n) minutes from a cron job. or if you like, you can just do it by hand using a sudo instead:

top -u -l 1 | head -20 | tail -12 | grep -v kernel | awk ' { print $1 } ' | xargs -n1 sudo renice -10

Have fun!

[ Reply to This | # ]