Automatic renicing of Boinc processes

Message boards : Questions and problems : Automatic renicing of Boinc processes
Message board moderation

To post messages, you must log in.

AuthorMessage
Anonamouse

Send message
Joined: 3 Jun 08
Posts: 3
United States
Message 17620 - Posted: 3 Jun 2008, 1:19:38 UTC

I'm running Boinc on a system that is running OS X Leopard. I'm happy to give Boinc 100% of my spare cycles, but Boinc seems to run with a sufficiently high priority that it slows my system down significantly, because it is competing with other processes for CPU time. I reniced the two world community grid processes that are currently running on the system, and the reponsiveness of the system went way up. But I imagine that this will only work while those two specific processes are running, and I want ALL boinc hosted processes to run with minimum priority so that they don't impact my other work. I also want this to occur on all systems (regardless of platform) on which I run Boinc (I run Windows and Linux clients as well.) Is there a way to force boinc to always run its processes as "nice"ly as possible? If so, how? If not, can this be built into Boinc as a preference? (Reducing the CPU usage of Boinc isn't what I'm looking for - I really do want to give it all my spare cycles, and reducing by 10 or 20% doesn't seem to help with the scheduling issue. Running only when I'm idle doesn't help either, because I'm on this computer much of the time (reducing the time when Boinc could run), and because running at 100% actually keeps the fans on this system running more quietly (it's an issue with this particular model of PowerMac.)

So, in summary:
I'd like Boinc processes to automatically run with my chosen niceness level, with the ability to set that level provided as a preference in the Boinc manager.

Thanks!

Thanks!
ID: 17620 · Report as offensive
Nicolas

Send message
Joined: 19 Jan 07
Posts: 1179
Argentina
Message 17621 - Posted: 3 Jun 2008, 3:00:50 UTC

As far as I know, BOINC already runs processes "as nice as they can go". Maybe Leopard increased the range of nice values?
ID: 17621 · Report as offensive
cmd1234

Send message
Joined: 6 Jun 08
Posts: 2
United Kingdom
Message 17703 - Posted: 6 Jun 2008, 11:57:09 UTC - in response to Message 17621.  

As far as I know, BOINC already runs processes "as nice as they can go". Maybe Leopard increased the range of nice values?



When I used 10.4.* it use to nice the process but since I have moved to 10.5.*, it no longer nice the process and give me lots of problems with the use of the CPU, to the point that I have had to stop using it, I am hoping that the new version (6.*) will resolve the issue .
ID: 17703 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15487
Netherlands
Message 17704 - Posted: 6 Jun 2008, 12:20:43 UTC - in response to Message 17703.  

It's not up to BOINC to run applications as nice as can be. That's up to the developers of those applications to set the level of priority.

So if your OS changed the priority of applications (BOINC always runs at Normal priority, only the applications run at Idle-Lowest), it's more something to check with the developers of the OS. Or else ask at the projects you run if something changed in the running of the applications.

BOINC 5 or BOINC 6 won't change that.
ID: 17704 · Report as offensive
Charlie Fenton
Project developer

Send message
Joined: 17 Jul 06
Posts: 287
United States
Message 17715 - Posted: 6 Jun 2008, 23:12:39 UTC - in response to Message 17703.  

When I used 10.4.* it use to nice the process but since I have moved to 10.5.*, it no longer nice the process and give me lots of problems with the use of the CPU, to the point that I have had to stop using it, I am hoping that the new version (6.*) will resolve the issue .

There is a known bug in Leopard that the underlying API used by Activity Monitor for measuring the process priority ("nice" value) doesn't work. Apparently the same faulty API is used by some third-party utilities (such as MenuMeters. I submitted a bug report to Apple regarding this on March 5).

You will notice that Activity Monitor on Leopard always shows a "% nice" value of 0.

You can run the following from terminal to see the correct nice value of each process:

ps -axcocommand,nice

On Leopard, I get the following (showing Rosetta@home and SETI@home with a nice value of 19) even though Activity Monitor shows Nice at 0:
COMMAND NI
launchd 0
kextd 0
DirectoryService 0
----- [ snip] ------
BOINCManager 0
boinc 0
mdworker 17
----- [ snip] ------
rosetta_beta_5.9 19
setiathome_5.28_ 19
mdworker 17
----- [ snip] ------

Cheers,
--Charlie
Charlie Fenton
BOINC / SETI@home Macintosh & Windows Programmer
ID: 17715 · Report as offensive
cmd1234

Send message
Joined: 6 Jun 08
Posts: 2
United Kingdom
Message 17762 - Posted: 10 Jun 2008, 7:52:05 UTC - in response to Message 17715.  

When I used 10.4.* it use to nice the process but since I have moved to 10.5.*, it no longer nice the process and give me lots of problems with the use of the CPU, to the point that I have had to stop using it, I am hoping that the new version (6.*) will resolve the issue .

There is a known bug in Leopard that the underlying API used by Activity Monitor for measuring the process priority ("nice" value) doesn't work. Apparently the same faulty API is used by some third-party utilities (such as MenuMeters. I submitted a bug report to Apple regarding this on March 5).

You will notice that Activity Monitor on Leopard always shows a "% nice" value of 0.

You can run the following from terminal to see the correct nice value of each process:

ps -axcocommand,nice

On Leopard, I get the following (showing Rosetta@home and SETI@home with a nice value of 19) even though Activity Monitor shows Nice at 0:
COMMAND NI
launchd 0
kextd 0
DirectoryService 0
----- [ snip] ------
BOINCManager 0
boinc 0
mdworker 17
----- [ snip] ------
rosetta_beta_5.9 19
setiathome_5.28_ 19
mdworker 17
----- [ snip] ------

Cheers,
--Charlie



Your right all the processes are niced..

There seems to be a problem with climateprediction.net, it dose not like the new Spaces that you get with 10.5, if you switch off spaces every thing works ok, switch it on and have climateprediction.net working and the cursor jumps all over the place
ID: 17762 · Report as offensive
Profile Gary Charpentier
Avatar

Send message
Joined: 23 Feb 08
Posts: 2465
United States
Message 20711 - Posted: 8 Oct 2008, 18:51:29 UTC - in response to Message 17620.  
Last modified: 8 Oct 2008, 18:53:10 UTC

I'm running Boinc on a system that is running OS X Leopard. I'm happy to give Boinc 100% of my spare cycles, but Boinc seems to run with a sufficiently high priority that it slows my system down significantly, because it is competing with other processes for CPU time. I reniced the two world community grid processes that are currently running on the system, and the reponsiveness of the system went way up. But I imagine that this will only work while those two specific processes are running, and I want ALL boinc hosted processes to run with minimum priority so that they don't impact my other work. I also want this to occur on all systems (regardless of platform) on which I run Boinc (I run Windows and Linux clients as well.) Is there a way to force boinc to always run its processes as "nice"ly as possible? If so, how? If not, can this be built into Boinc as a preference? (Reducing the CPU usage of Boinc isn't what I'm looking for - I really do want to give it all my spare cycles, and reducing by 10 or 20% doesn't seem to help with the scheduling issue. Running only when I'm idle doesn't help either, because I'm on this computer much of the time (reducing the time when Boinc could run), and because running at 100% actually keeps the fans on this system running more quietly (it's an issue with this particular model of PowerMac.)

So, in summary:
I'd like Boinc processes to automatically run with my chosen niceness level, with the ability to set that level provided as a preference in the Boinc manager.

Thanks!

Thanks!


boinc [lower case] runs with a nice value of zero. It forks the science apps. It is up to the science app to call nice if it wants to. From what you are saying world community grid does not do so. As this matters to you, drop them as a project. If you want to be nice send them an e-mail and tell them why. You have just run into one of the reasons many people won't run anything but open source software.

But to answer your question, if you nice boinc not BOINCManager then when it forks the science applications they will be niced. Nice is one of the values that is preserved when a parent process forks a child.

I don't know if setting a nice value for boinc will cause problems. I suspect that it could.

And as boinc is open source you could compile your own version that only forks niced children.

Gary
ID: 20711 · Report as offensive
Profile Tigers Dave

Send message
Joined: 24 Dec 05
Posts: 52
United States
Message 20876 - Posted: 18 Oct 2008, 17:54:43 UTC - in response to Message 20711.  

I have been suffering from the same slow-down problem as others have reported (Mac Book Pro, OS X 10.5.5, BOINC Manager 6.2.18). I tried resetting process priorities using the renice command and I monitored the effects by timing how long it took to open a large Microsoft Word document. When BOINC Manager is not running, it took 20 seconds to open this document. When BOINC Manager is running, it took 90 seconds to open the document.

I used the renice command (in terminal) to set the nice value to 1 for the "BOINC" process. It took 70 seconds to open the document.

I used the sudo renice command to set the nice value to 1 for the "boinc" process. It still took 70 seconds to open the document.

I used the sudo renice command to set the nice value to 1 for both "minirosetta_1.34" processes (my MBP has a dual core processor). It took 40 seconds to open the document.

Once I restarted the computer, all changes were apparently lost - it took 90 seconds to open the document. I used the sudo renice command to set the nice value to 1 for both "minirosetta_1.34" processes. It now took 40 seconds to open the document.

Conclusions:
- Sudo renice can be used to decrease the priority of the processes and increase computer speed.
- Not all of the speed penalty imposed by BOINC Manager and the science applications can be recovered.
- Moreover, changes imposed by sudo renice do not survive a warm restart.

For information about using the renice and sudo renice commands to modify program priority levels, please direct your web browser to:

http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.mac.system/2008-02/msg00450.html

Best of luck in speeding up your machines! Please post follow-ups if you have had more success than I have!

Dave


ID: 20876 · Report as offensive
Profile Tigers Dave

Send message
Joined: 24 Dec 05
Posts: 52
United States
Message 20877 - Posted: 18 Oct 2008, 18:23:07 UTC

Just to follow up my previous post, here is how changing "niceness" affected the speed of my machine:

Before changing niceness (19 is default): 90 seconds to open MS Word document
Niceness = 1: 40 seconds to open document
Niceness = 19: 70 seconds to open document
Niceness = -19: 30 seconds to open document

This is very strange, because 19 is supposed to be low priority and -19 is supposed to be high priority. Yet, my testing indicates the exact opposite. This problem does not appear to affect my non-intel Macs running OS 10.5.5, so perhaps this is a bug that is specific to the Intel build of 10.5.5.

I'll experiment with my other intel and non-intel systems and see if this appears to be the case.

Again, I would appreciate it if anyone with insights into this issue would post them!

Dave


ID: 20877 · Report as offensive
Profile Gary Charpentier
Avatar

Send message
Joined: 23 Feb 08
Posts: 2465
United States
Message 20892 - Posted: 19 Oct 2008, 21:59:53 UTC - in response to Message 20876.  

snip of good info
Once I restarted the computer, all changes were apparently lost - it took 90 seconds to open the document. I used the sudo renice command to set the nice value to 1 for both "minirosetta_1.34" processes. It now took 40 seconds to open the document.

Conclusions:
- Sudo renice can be used to decrease the priority of the processes and increase computer speed.
- Not all of the speed penalty imposed by BOINC Manager and the science applications can be recovered.
- Moreover, changes imposed by sudo renice do not survive a warm restart.

For information about using the renice and sudo renice commands to modify program priority levels, please direct your web browser to:

http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.mac.system/2008-02/msg00450.html

Best of luck in speeding up your machines! Please post follow-ups if you have had more success than I have!

Dave


The best information on nice and renice is your man pages. Open terminal. Type "man nice" without quotes and read. (space for next page and Q exits the page reader) Type "man renice" and read.

To get the info on what your system is doing with the science applications type "ps -AlUboinc_project" You can check "man ps" to see all the options for the program and what all the columns are telling you.

You are correct that nice values do not survive a restart. Also if you don't have BOINC set to leave applications in memory when suspended they won't survive being paused and restarted. Also they won't survive to the next work unit on the same project.

Finally about those open times, when you open Word the second time the kernel may find that parts of the program are still in caches and not read it off the disc.

Gary

I would be very surprised if the Intel build of 10.5.5 had the nice values upside down. That would break a lot of code and I don't think it could make it out the door that way.

ID: 20892 · Report as offensive
Profile Tigers Dave

Send message
Joined: 24 Dec 05
Posts: 52
United States
Message 20899 - Posted: 20 Oct 2008, 13:01:51 UTC - in response to Message 20892.  

... snip

<Finally about those open times, when you open Word the second time the kernel may find that parts of the program are still in caches and not read it off the disc.>

Hi Gary:

Thanks for your thoughtful and helpful comments. I did think of this issue. For the sake of brevity, I omitted the following test data:

NIceness set at 19 (default): 70 seconds to open document
Renice to -19: 30 seconds to open document
Renice to 19: 70 seconds to open document
Renice to -19: 30 seconds to open document

Note that I did not reboot between any of these trials. So, doesn't it appear that setting "niceness" to -19 increases the speed of my machine? What else could be accounting for this effect?

By the way, tests run with Activity Monitor, Terminal, Safari, Excel, and Mail open gave identical results to tests run with nothing open. Therefore, these results do not appear to depend on how many other tasks are open, as long as there is not a CPU hog running (like a Photoshop filter) and as long as there is sufficient physical RAM available to load MS Word and my document.

Regards,

Dave

ID: 20899 · Report as offensive
Profile Gary Charpentier
Avatar

Send message
Joined: 23 Feb 08
Posts: 2465
United States
Message 20920 - Posted: 21 Oct 2008, 23:10:18 UTC - in response to Message 20899.  

... snip

<Finally about those open times, when you open Word the second time the kernel may find that parts of the program are still in caches and not read it off the disc.>

Hi Gary:

Thanks for your thoughtful and helpful comments. I did think of this issue. For the sake of brevity, I omitted the following test data:

NIceness set at 19 (default): 70 seconds to open document
Renice to -19: 30 seconds to open document
Renice to 19: 70 seconds to open document
Renice to -19: 30 seconds to open document

Note that I did not reboot between any of these trials. So, doesn't it appear that setting "niceness" to -19 increases the speed of my machine? What else could be accounting for this effect?

By the way, tests run with Activity Monitor, Terminal, Safari, Excel, and Mail open gave identical results to tests run with nothing open. Therefore, these results do not appear to depend on how many other tasks are open, as long as there is not a CPU hog running (like a Photoshop filter) and as long as there is sufficient physical RAM available to load MS Word and my document.

Regards,

Dave

I know that the niceness setting should be changing the scheduling policy.
For technical info on the scheduling policy see:
http://developer.apple.com/documentation/Darwin/Conceptual/KernelProgramming/scheduler/chapter_8_section_1.html#//apple_ref/doc/uid/TP30000905-CH211-BEHJDFCA

What I don't understand is why the renice values seem to be reversed.

What I know is that BOINC does not run as the super user so it can not set a priority lower than zero. BTW have you tried a value of zero?

It is a setting of positive 19 which would make them rather nice or the default. Setting them to -19 would make them very un-nice. More so than anything else on the system. I'm assuming you have verified the nice values with ps after you issued the renice command.

At this point I'm beginning to think Word may have something funny in it. Have you noticed any speed changes in any other applications?

Gary

ID: 20920 · Report as offensive
Profile Tigers Dave

Send message
Joined: 24 Dec 05
Posts: 52
United States
Message 20934 - Posted: 23 Oct 2008, 5:04:39 UTC - in response to Message 20920.  

Hi Gary:

Yes, I used the ps command to confirm that the nice levels were indeed as I set them using the remove command. The changes in the "speed" of MS Word reflected changes in the speed of other applications, including Finder.

All of this confuses me, too. When I get some time, I'll see if this issue is affecting my other intel macs running OS X 10.5.5. This doesn't affect my G4 or G5 macs running OS X 10.5.5, nor does it affect my intel macs running OS X 10.4.x. Too bad I depend on MobileMe so much - this problem makes me want to go back to OS X 10.4.x.

Dave
ID: 20934 · Report as offensive
Profile Gary Charpentier
Avatar

Send message
Joined: 23 Feb 08
Posts: 2465
United States
Message 20983 - Posted: 26 Oct 2008, 5:20:17 UTC - in response to Message 20934.  
Last modified: 26 Oct 2008, 5:21:03 UTC

Hi Gary:

Yes, I used the ps command to confirm that the nice levels were indeed as I set them using the remove command. The changes in the "speed" of MS Word reflected changes in the speed of other applications, including Finder.

All of this confuses me, too. When I get some time, I'll see if this issue is affecting my other intel macs running OS X 10.5.5. This doesn't affect my G4 or G5 macs running OS X 10.5.5, nor does it affect my intel macs running OS X 10.4.x. Too bad I depend on MobileMe so much - this problem makes me want to go back to OS X 10.4.x.

Dave

I did a little poking around with Word. Word, any MS office application, does not just launch itself, it launches several helper processes as well. Some of these helpers don't quit when you quit word. I even watched as it launched a couple of Apple applications, Calendar and Address Book. Dictionary was already open on my machine but I suspect that may be another. I think there are a few too many things going on to reach any solid conclusion, because there are too many variables that can't be controlled.

Looking at the absolute priority numbers (0 lowest 63 highest normally available) I see that with the default nice setting of 19 that they (science applications) are in the range of 12-18. Word is running about 46. Most everything else at 31 right in the middle. I had a Quicktime playing a video it it was 97 (more than 63) indicating it is a real time process.

I also noticed that Word uses CPU even when it is displaying no page at all and doesn't have a file open. Don't have a clue why it isn't asleep but because of that and that it runs higher than normal priority I could see some weird race happening where it could slow itself down while interacting with one of the lower priority helper processes it spawns.

Gary
ID: 20983 · Report as offensive
RandyOo

Send message
Joined: 4 Mar 09
Posts: 1
United States
Message 23443 - Posted: 4 Mar 2009, 0:16:48 UTC - in response to Message 20983.  

I just opened a new thread on Apple's support discussions:
http://discussions.apple.com/thread.jspa?threadID=1927337

I've noticed the same thing as Gary. Well, something similar, anyway... With an HD video being played back (at the highest possible priority), while watching the real-time statistics (frames per second, dropped frames), I did my own testing.

On a dual-core machine, with two WCG processes running at the default nice setting of 19 (and 2 threads each, I might add!), video playback is sluggish, dropped frames all over the place. Renice just ONE of the two WCG processes to -19, and it's all smooth like butter.

I currently have set up BOINC to suspend while a user is active, but things run drastically better with one process reniced to -19, enough that I'm happy to leave it running all the time! Maybe someone else can figure out what's going on... I was thinking along the same lines as Gary, some kind of strange race condition. Any ideas? I've got a quad core Mac Pro that I could also do testing on, if anyone has any ideas.
ID: 23443 · Report as offensive

Message boards : Questions and problems : Automatic renicing of Boinc processes

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.