From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 23 03:42:11 2020 Received: (at 42001) by debbugs.gnu.org; 23 Jun 2020 07:42:11 +0000 Received: from localhost ([127.0.0.1]:35385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jndZL-00015d-FC for submit@debbugs.gnu.org; Tue, 23 Jun 2020 03:42:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jndZK-00015R-BI for 42001@debbugs.gnu.org; Tue, 23 Jun 2020 03:42:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57860) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jndZF-0004Zj-2p for 42001@debbugs.gnu.org; Tue, 23 Jun 2020 03:42:05 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52508 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jndZD-0006sb-K4; Tue, 23 Jun 2020 03:42:04 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: bug#42001: =?utf-8?Q?=E2=80=9CSQLite?= database is =?utf-8?Q?busy=E2=80=9D=3A?= contention on the store database References: <877dvz7228.fsf@gnu.org> <87pn9rdr8r.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Messidor an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 23 Jun 2020 09:42:02 +0200 In-Reply-To: <87pn9rdr8r.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 22 Jun 2020 18:01:24 +0200") Message-ID: <87y2oe44ad.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42001 Cc: 42001@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Mathieu Othacehe skribis: >> utimensat(AT_FDCWD, "/gnu/store/whhc80cx1zpi9cj3bil3sp8wwzcf8p9p-image-r= oot/gnu/store/n6l40ygclxfysnc2nxwrslnn5ab6wv3v-profile/lib/modules/5.4.47-g= nu/kernel/net/netfilter", [{tv_sec=3D1592814617, tv_nsec=3D396083395} /* 20= 20-06-22T10:30:17.396083395+0200 */, {tv_sec=3D1, tv_nsec=3D0} /* 1970-01-0= 1T01:00:01+0100 */], 0) =3D 0 >> chmod("/gnu/store/whhc80cx1zpi9cj3bil3sp8wwzcf8p9p-image-root/gnu/store/= n6l40ygclxfysnc2nxwrslnn5ab6wv3v-profile/lib/modules/5.4.47-gnu/kernel/net/= netfilter", 040555) =3D 0 >> getrusage(RUSAGE_SELF, {ru_utime=3D{tv_sec=3D1306, tv_usec=3D334062}, ru= _stime=3D{tv_sec=3D143, tv_usec=3D819675}, ...}) =3D 0 >> clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=3D1450, tv_nsec=3D153748= 295}) =3D 0=20 >> lstat("/gnu/store/whhc80cx1zpi9cj3bil3sp8wwzcf8p9p-image-root/gnu/store/= n6l40ygclxfysnc2nxwrslnn5ab6wv3v-profile/lib/modules/5.4.47-gnu/kernel/net/= netfilter/xt_connlimit.ko", {st_mode=3DS_IFLNK|0777, st_size=3D125, ...}) = =3D 0 > > As discussed on IRC, those "image-root" derivations do exercise store > deduplication a lot, are could participate to the observed database > contention. > > Turns out I used those derivations as "staging" directories that are > passed to GNU Xorriso when producing ISO images and "mke2fs" and > "mkdosfs" when producing raw disk-images. Using the store was also > convenient to ensure root ownership of the image files. > > With 1cb9effc3e875ec7bae31bb06069d16ac89f7e1d and > 7f75a7ec08975eb6d6e01db61bd6b91f447f655e, I remove those "image-root" > derivations, and proceed to image creation in a single derivation. Nice, thanks for the prompt change! I=E2=80=99ve been monitoring berlin a bit and I=E2=80=99ve become quite con= vinced that these big directories are what triggered contention. The good thing is that this has allowed us to find weaknesses in (guix store database) and (guix store deduplicate). > The later commit is a bit more tricky because "mke2fs" is not able to > override file permissions. I used "fakeroot" to make sure that the raw > disk-image files are owned by "root" and not "guixbuilder". OK, makes sense. Maybe at some point we=E2=80=99ll have to use libext2fs directly or patch m= ke2fs to get the desired flexibility. Thank you! Ludo=E2=80=99.