From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id a2GFA5Wy8V7dFwAA0tVLHw (envelope-from ) for ; Tue, 23 Jun 2020 07:43:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sNpTOpSy8V65fAAAbx9fmQ (envelope-from ) for ; Tue, 23 Jun 2020 07:43:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 64303940667 for ; Tue, 23 Jun 2020 07:43:14 +0000 (UTC) Received: from localhost ([::1]:43326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jndaL-0006uW-0d for larch@yhetil.org; Tue, 23 Jun 2020 03:43:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jndaA-0006ty-JT for bug-guix@gnu.org; Tue, 23 Jun 2020 03:43:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jndaA-0004m4-Aa for bug-guix@gnu.org; Tue, 23 Jun 2020 03:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jndaA-00016h-7n for bug-guix@gnu.org; Tue, 23 Jun 2020 03:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#42001: =?UTF-8?Q?=E2=80=9CSQLite?= database is =?UTF-8?Q?busy=E2=80=9D:?= contention on the store database Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 23 Jun 2020 07:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42001 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Mathieu Othacehe Received: via spool by 42001-submit@debbugs.gnu.org id=B42001.15928981314197 (code B ref 42001); Tue, 23 Jun 2020 07:43:02 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 42001@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: gVmNJLdC5VAM 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.