Build niceness

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Thu Nov 1 11:41:05 UTC 2018


On 2018-10-18 18:08, Erik Joelsson wrote:
> Hello Aleksey,
>
> We very deliberately added the automatic niceness for a better general 
> user experience. This was back when build-infra was new and we started 
> pushing the parallelism of the build to where the UIs of our 
> development systems became annoyingly slow and sluggish when building. 
> So, I would be very against removing it completely, but I certainly 
> think it should be possible to opt out. We should never force such a 
> behavior on an unwilling user. My only defense is that this was done 
> so early so we probably didn't think about it. If you would like to 
> provide a patch adding a configure arg for disabling it, it would 
> certainly be welcome.

An alternative, I suspect, is to lower the value that is added to the 
niceness, e.g. using "nice -n5" or even just "nice -n1". This sounds 
like it should help with your particular case, and I still think it 
would solve our original problem, that developer's workstations should 
not be unresponsive while building.

I was about to suggest that you could achieve this by overriding NICE in 
the configure command line, by e.g. configure NICE="/usr/bin/nice -n0" 
(I presume -n0 is a no-op), but it turned out that this did not work! :( 
I opened JDK-8213239 for this, but for the moment, that's not a usable 
workaround...

/Magnus

>
> /Erik
>
>
> On 2018-10-18 01:08, Aleksey Shipilev wrote:
>> Hi,
>>
>> Is there any specific user story behind "nice"-ing the compilation 
>> jobs from within the build system?
>>
>> It unfortunately clashes with priority budgeting. For example, my 
>> build server is used by me doing
>> adhoc builds, automatic builds and some background tasks. The 
>> automatic build user has priority 10
>> set in /etc/security/limits.conf. The background user has priority 20 
>> set in limits.conf. In theory,
>> it sounds good: it would get all the CPU ad-hoc builds want, then 
>> give CPU to automatic build jobs,
>> then to background jobs.
>>
>> But then the build nice-s the compilation jobs, which drops its 
>> priority down to the priority of
>> background jobs:
>>
>>    PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM TIME+ COMMAND
>>
>>
>> 25966 backgro+  39  19  808872 460772   2440 R  97.0  1.4 4181:54 R
>>
>>
>> 25968 backgro+  39  19  808872 460588   2340 R  97.0  1.4 4181:17 R
>>
>>
>> 25965 backgro+  39  19  808872 460864   2680 R  93.4  1.4 4180:29 R
>>
>>
>> 30998 buildbot  39  19 6688224 1.050g  20000 S  64.8  3.4 4:58.52 java
>>
>>
>> 27518 buildbot  39  19 2915828 110884  21740 S  47.0  0.3 0:02.57 javac
>>
>>
>> 26802 buildbot  39  19  290900 264792  17392 R  38.2  0.8 0:05.48 
>> cc1plus
>>
>>
>> 27486 buildbot  39  19  200296 171792  18440 R  30.6  0.5 0:01.96 
>> cc1plus
>>
>> ...which wrecks up this story. Maybe the better solution in build 
>> system is to avoid nice-ing at
>> all, and require users who need it to invoke "nice -n ... make ..."? 
>> Or maybe at least have the knob
>> that disables automatic niceness?
>>
>> Thanks,
>> -Aleksey
>>
>



More information about the build-dev mailing list