Task scheduling priority in BOINC on Linux

StefanR5R

Elite Member
Dec 10, 2016
5,542
7,890
136
I was just messing around with my PrimeGrid LLR2 test script. Particularly, I wanted to enable it to launch LLR2 at different OS process priority settings. After all, the BOINC client launches science tasks at very low priority by default, in order to reduce interference with foreground tasks outside of BOINC.

Here is what I learned:
  • The values of the cc_config.xml parameter <process_priority> translate to Linux' "niceness" values like this:
    process_priority = 0 (lowest priority, the default) --> niceness = 19
    process_priority = 1 (below normal) --> niceness = 10
    process_priority = 2 (normal) --> niceness = 0 (I presume, I didn't test it)
  • However, I found on a Gentoo Linux box that boinc-client itself (i.e., the default primary client instance) is launched with a niceness of 19, which makes it unable to start science tasks at any other niceness than 19. And on a OpenSuse box, boinc-client (primary instance) is launched with a niceness of 10, which makes it unable to start science tasks at any other niceness than 19 or 10.
  • But even these niceness values do not actually apply to LLR2 science tasks. At least sllr2_1.3.0_linux64_220821 is manipulating its niceness itself. By default, it sets it to 19. With -oPriority=8 or higher in its command line, it sets its niceness to 0 (if it is allowed to). -oPriority=7 means niceness=2, 6 is 5, 5 is 8, 4 is 11, 3 is 14, 2 is 17, and finally, -oPriority=1 or lower causes it to set its niceness to 19.

So, as far as my LLR2 test setup is concerned, it already is running LLR2 at the same OS task scheduling priority as BOINC is. Because both when launched from the script or from BOINC, LLR2 lowers its priority as much as possible, to the maximum niceness level of 19.

To change LLR2's behavior in this regard in BOINC, one would have to somehow arrange for PrimeGrid's LLR wrapper to pass a respective -oPriority setting to LLR2, and one would have to modify cc_config.xml and possibly also the boinc-client startup script (usually, a systemd service unit file).