From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. R. Haigh (re. Guix)" Subject: Re: Default autogroup niceness of Guix build daemon Date: Tue, 28 Jan 2020 03:56:17 +0000 Message-ID: <20200128035617.221e6991@jrhaighs-debian-x200> References: <20200125223016.39ce19c7@jrhaighs-debian-x200> <87eevkiyvi.fsf@roquette.mug.biscuolo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54765) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwHza-0003h1-NT for help-guix@gnu.org; Mon, 27 Jan 2020 22:56:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwHzZ-0007Ad-4T for help-guix@gnu.org; Mon, 27 Jan 2020 22:56:46 -0500 Received: from aibo.runbox.com ([91.220.196.211]:38752) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iwHzY-00078R-KB for help-guix@gnu.org; Mon, 27 Jan 2020 22:56:45 -0500 In-Reply-To: <87eevkiyvi.fsf@roquette.mug.biscuolo.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: Giovanni Biscuolo , help-guix@gnu.org Hi Giovanni, At 2020-01-27Mon18:37:53+01, Giovanni Biscuolo sent: > [=E2=80=A6] > Since Debian 9 [uses] systemd, should be possible by configuring a limit = in the systemd service unit file [1]; I've never tried but try adding "Limi= tNICE=3D19" in the [Service] stanza. Thanks for the suggestion. I tried it and it seemed to only affect process = niceness, not autogroup niceness. Htop reported process niceness values of = 19 on the relevant processes, and I already knew that setting these manuall= y from Htop does not fix the lag. Autogroup niceness still defaults to 0: $ (for P in $(ps --group=3D"guixbuild" --format=3D"pid=3D"); do F=3D"/proc/= $P/autogroup"; echo "$F"; cat "$F"; done) /proc/26741/autogroup /autogroup-12141 nice 0 > Documentation on that parameter here: > https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Proces= s%20Properties Thank you. There does not seem to be anything on autogroup niceness there, = which is apparently deliberate, unfortunately. I also tried =E2=80=98LimitN= ICE=3D+19=E2=80=99 and =E2=80=98CPUSchedulingPolicy=3Didle=E2=80=99 but nei= ther prevented Guix builds from hogging the CPU. As well as reloading the S= ystemD configuration, I also tried interrupting the build and starting it a= gain, but the lag returned as soon as the build got going again. As a temporary workaround, I tried disabling CFS's autogrouping feature wi= th: sudo tee /proc/sys/kernel/sched_autogroup_enabled <<<0 =E2=80=A6but it did not seem to do anything, despite Htop reporting that th= e relevant processes have a process niceness of 19. It seems that autogroup= ing is still enabled, despite the attempt to disable it, because the comman= d in my previous email (repeated below) to imperatively change the autogrou= p niceness (to 19 and then back to 0) continues to have unmistakable effect= on interactivity. As all other attempts so far have had no noticeable effe= ct, that command remains to be the only workaround so far: $ (for P in $(ps --group=3D"guixbuild" --format=3D"pid=3D"); do F=3D"/proc/= $P/autogroup"; echo "$F"; cat "$F" && sudo tee "$F" <<<19; done) /proc/26741/autogroup /autogroup-12141 nice 0 [sudo] password for JRHaigh:=20 19 $ (for P in $(ps --group=3D"guixbuild" --format=3D"pid=3D"); do F=3D"/proc/= $P/autogroup"; echo "$F"; cat "$F" && sudo tee "$F" <<<0; done) ## /proc/26741/autogroup /autogroup-12141 nice 19 0 $ (for P in $(ps --group=3D"guixbuild" --format=3D"pid=3D"); do F=3D"/proc/= $P/autogroup"; echo "$F"; cat "$F" && sudo tee "$F" <<<19; done) /proc/26741/autogroup /autogroup-12141 nice 0 19 These cammands very clearly made my system responsive, laggy, and then resp= onsive again, which was totally unexpected seeing as I had supposedly disab= led autogrouping. Given that there are reasons why autogrouping was added a= nd has been default on most/many distros for many years, it would be best i= f the solution worked with autogrouping enabled anyway, so I don't really w= ant to waste time investigating why autogrouping does not seem to get disab= led. Are there any modifications that could be made to the Guix daemon to fix t= his? Seeing as SystemD apparently does not support autogroup niceness, perh= aps the next best alternative is to fix the CPUSchedulingPolicy setting. I'= m guessing that it only affects the Guix daemon and does not cascade to its= builders. Fixing the CPUSchedulingPolicy setting might provide a decent, d= eclarative solution for build deprioritisation that could be used instead o= f niceness. Regards, James R. Haigh. --=20 4 days, 5 hours, and 4 minutes left until FOSDEM 2020 (Saturday)! 5 days, 5 hours, and 4 minutes left until FOSDEM 2020 (Sunday)! Wealth doesn't bring happiness, but poverty brings sadness. https://wiki.FSFE.org/Fellows/JRHaigh Sent from Debian with Claws Mail, using email subaddressing as an alternati= ve to error-prone heuristical spam filtering.