Ubuntu Process Priority

Associate
Joined
9 Mar 2008
Posts
1,039
Hi,

Im pretty new to linux and I want to be able to change the priority of a process so that it executes above all else - i dont really care if it slows desktop performance or chokes other programs, like changing the priority in windows to 'high'. If its any help, i am using Ubuntu 8.04.1 server with the GNOME gui. Googling reveals the nice commands can be used. I have tried using the following as root to change the priority to the highest possible:

sudo su -
renice -19 <process PID>

This sets the nice value of the process to -19 (and according to the readout from the 'top' command sets its 'PR' value to 1), but using other apps/general desktop input really slows the process im interested in down. Changing the priority in the system manager does nothing as far as i can make out. Is there a way around this? As i said, i dont mind at all if it really chokes desktop performance. Im sure there must be a way to do it, but i cannot work out what it is!

Thanks, any help/advice is appreciated.
 
Are you saying that this makes your desktop sluggish, or that using the desktop makes the program sluggish?

-19 is the highest priority available, be very careful with it, try -1 if you don't absolutely need it to process on demand.
 
Last edited:
Appologies if i was not clear. Billy is right, im runing FAH, and using the desktop or any programs really does seem to have a bad impact on the FAH applications. Just using opera/firefox or songbird reduces the speed at which FAH executes by quite a bit (up to 20% i guess from the drop in speed). Obviously leaving the machine alone, it runs fine, but changing the priority seems to do nothing. As i said, i have tried setting it's nice value to -19/-20, and it makes absolutely no difference - any other application running seems to take precedence. The machine is far from old - its a Q6600 clocked to 3.3 ghz. To be honest, its not all that important, but it seems a little odd to me!

Could it be that running a desktop on the server version is not very efficient? Or is this a result of the linux scheduler?

Thanks for the replies - its much appreciated.
 
Something does seem a bit odd there. Setting FAH to -19 should more or less bring the box to it's knees, certainly, that was the case with SETIATHOME. -19 really does mean "stop whatever you're doing and jump right on whatever this program wants, and do it NOW!"

BUT, I do seem to recall a "nice resistant" program or two once upong a time. Maybe, and I stress maybe, because I AM the guy who proves that you don't need a degree in conversational C++ to run Linux, MAYBE....it's possible to "hard code" a nice level of sorts into the actual guts of a program, so that even if you give it carte blanche to do whatever it likes to your CPU, it just will not. If such a thing were possible, one would expect that FAH would be a prime candidate for it, given it's normal mode of use.
 
I want it to bring it to its knees, it just wont! Unfortunately i have picked up some bad WUs, so experimenting cant really be done at the moment, but it all seemed to make little difference anyway. The real problem is trying to get the clients to use all of the cpu power available - no matter what i try, i cannot get the clients to use 100% of the cpu time. Quite a few people on the official forum have reported a similar problem, with the cpu clients only using about 85% of the available cpu time. This would be fine - it should allow ~15% of the processors power to be used for gfx card clients and for desktop apps, but rather than use the 'free' processor power, all other processes just seem to suck processor time away from the main cpu client, which is very odd indeed. I cant really seem to solve the problem - as i said, nice commands seem to do nothing. The only thing i can think of is to compile a kernel without the 'fair scheduler' and see if it makes a difference, but im a bit sick of compiling kernels and the hassle that follows with driver installations... I might give it a go later and see if it makes a difference, but im not too hopeful...
 
Well, i was suitably bored and had a go at compiling a custom kernel without the fair scheduler. It has not made any difference at all, but to be honest, i didnt expect it to.
I think im going to move this machine back to windows for folding - its a lot easier to manage, and to be honest, better suited. Nevermind, it was worth a go, and i leanred a fair bit about linux along the way - thanks for the input guys.
 
Prior to trying to use 'native' linux, F@H was running on virtual machines (not sure if you have kept up with F@H, but basically the linux client is heaps better!), along with two graphics card clients. The Windows scheduler allowed the priorities to be balanced such that the GPUs always had enough cpu time to run at full speed, and the VMs ran in the background. I decided to move over to linux temporarily largely because running the combination of VMs and gfx card clients requires quite a lot of monitoring and babysitting. I also do not need to use windows apps for the next few weeks, so thought a switch to linux may make things easier.

Installing all of the clients and running them on Linux is not a problem - they will happily sit there and tick over, but they will not use all of the PCs resources like windows. I think i need to give an example, so here goes... Running just the SMP cleint on its own (and leaving the machine alone) results in about 95% cpu usage, which should theroetically leave the remaining 5% cpu time to run the gfx clients (which need almost no cpu input). However, in practice, the overall cpu usage will not go above 90% when both are running side by side, which means both clients run quite slowly. I have been trying to give the cpu client the highest priority possible to get over this issue, and understood that nice commands were the way to do this. As i say, the cpu client should use most of the processors power and leave a small amount to run the graphics card clients.

I think perhaps i should have used a smilie when i said i want the clients to bring the desktop to its knees - i dont, not quite! :D . I would like to be able to use it for web access, reading pdfs etc (nothing intensive), and i fully understand that this would degrade the performance of the clients. The desktop also makes it a lot easier to monitor whats happening with the clients. However, it spends most of its time 'inactive', pretty much just siting there (so the desktop should be doing nothing). At this point i would be happy for it to use all of the resources available, and make the desktop unusable, but this does not happen, despite setting the nice values to -19. I was under the impression that with such a high priority, even when i wanted to use the desktop i would be unable to, but this does not seem to hold true, nor does changing the nice value seem to have any impact on how the scheduler distributes the load. If any of this is wrong, please say so - i quite like linux, but it just seems a little impractical at the moment!

I hope that clears things up a little, and if not, dont worry!
 
Last edited:
Back
Top Bottom