Koozali.org formerly Contribs.org

some code to help keep your system more multi tasking friendly

Offline purvis

  • ****
  • 567
In running programs that are resource hogs or intense(sounds like my character).
I find I keep placing this code in my programs. It helps just about every time i need a program to not hog the computers resources.
I find this code very useful where the computer is making a lot of reads and writes to the hard drive.

I find it useful even when running a daily or weekly clamscan.
If your system is having some hot running issues, you might want to try placing this code in some of your works as well.
IF you run a child routine from this code, the child routine will take on the same attributes.
I am surprised i have not seen much of it spoke of here.(basically nothing of word of it in the forums.)
I usually place the code at the start of bash script or where a bash script starts another routine.
One single processors and slower drives, I am seeing a speed up in my programs because a process does not take
up all the cpu time.
I use this bit of code more than CPULIMIT which is popular. I had to download and compile CPULIMIT.

Code: [Select]
/usr/bin/renice 19 -p $$ > /dev/null
/usr/bin/ionice -c3 -n7 -p $$ > /dev/null