From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 17 23:36:10 2020 Received: (at submit) by debbugs.gnu.org; 18 Oct 2020 03:36:10 +0000 Received: from localhost ([127.0.0.1]:35973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTzUQ-0005c9-DS for submit@debbugs.gnu.org; Sat, 17 Oct 2020 23:36:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:55440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTzUP-0005c1-3R for submit@debbugs.gnu.org; Sat, 17 Oct 2020 23:36:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTzUO-0000FZ-TE for bug-guix@gnu.org; Sat, 17 Oct 2020 23:36:08 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:33072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTzUL-0003wx-8e for bug-guix@gnu.org; Sat, 17 Oct 2020 23:36:08 -0400 Received: by mail-io1-xd31.google.com with SMTP id r4so9101837ioh.0 for ; Sat, 17 Oct 2020 20:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=EQL4wUvP0JzwEWDcs8iEsIPm/XDUsVG66N4fK8x/OEI=; b=o7GDX4qfbo3wYyLroWwt9kI3lXhypiQ1dvg8OkHLF8Y3cs7BvcKiEbcgS/i6ZyiUYK rO6q/gtm28vv87WqwGJUVkgIkhQKMxjS2u+zbKYzji/laPjoRnE3RuzeUh894wAQkRIf 29O4ywFs4X2XObC621gfkqq1yZiTIjbbFf6dJAJDKCGbjxOcQ5QChiWdYEqLm3r4fVoN YUHJXJi4nci2tmZq+Anyex+4bhovorzKpsp6/tMtAmwYLvmyPeEGFwQr1IKWppaJi9AV d51Q+cqwZdSnG5S6CQdwNfhN1vHqkObMYZICCJowO1Snh/blL6CxjlP/7eqVzk98jlHM uvXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=EQL4wUvP0JzwEWDcs8iEsIPm/XDUsVG66N4fK8x/OEI=; b=Y3s32c0pf67qzdJy+7Q+pAFX7f1MFzqkJPTwnXS7RRWsJz3t4qjH0Gyu1+eC13H9lc vw/xbqmJso5CJ7ve8WKnY/YsRqcN+x7vupkwiRfEBp0zoyse/bGRxlveT7Urqxk+tIaD 3is05SdSsLngz8M9pK4AnPV9ZkAOfFQk3/VKFCqdKw1usYDHOn5xU/GKLYdi9jwsC7uM 73IWX2qw0nKiUcMdKOi9DFFamrDL3/UUyn1ejWFu72S/nNRZxS6yMU4Xpp9X4lZXpyTF cBnxcpc+aFbQwQp0w2/cefwdbmTC1s8kVoTgMdU6mlU8ol6dyIcqFs1g3QSx2bcU4+s7 7IYg== X-Gm-Message-State: AOAM531uVN26Ug9u08kGzjm7KV59z4ZgCw5gLLLkeBB/UbrP/9p4IfOs kddgHgSgCSYOeOUL0l459MiCARcWes4= X-Google-Smtp-Source: ABdhPJw8iYb3PoK5GTIrwuSgnOB5FZnuKUtOQOZc/z72kyn0mOKvUZsy85AYFr+8prXyTXydKo8D6g== X-Received: by 2002:a6b:1542:: with SMTP id 63mr7022979iov.64.1602992163761; Sat, 17 Oct 2020 20:36:03 -0700 (PDT) Received: from hurd (dsl-205-233-125-118.b2b2c.ca. [205.233.125.118]) by smtp.gmail.com with ESMTPSA id t10sm6408050iog.49.2020.10.17.20.36.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 20:36:03 -0700 (PDT) From: Maxim Cournoyer To: bug-guix Subject: Poor profile generation performance on spinning disks Date: Sat, 17 Oct 2020 23:35:45 -0400 Message-ID: <87zh4k435a.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::d31; envelope-from=maxim.cournoyer@gmail.com; helo=mail-io1-xd31.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit 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: -2.3 (--) Hello! I've noticed on multiple occasions that using Guix on traditional spinning drives can be quite slow. On my home machine, will is still relying on 2 x 1 TB spinning drives in RAID1, rebuilding my user profile, which contains 182 entries, takes on average about 20 minutes, even when there are no packages to be built: --8<---------------cut here---------------start------------->8--- $ time guix package -i perl --max-jobs=1 The following package will be upgraded: perl (dependencies or package changed) The following derivation will be built: /gnu/store/lhywla1z2zcz16df4hbvvvngr9zmswr7-profile.drv building CA certificate bundle... building fonts directory... generating GLib schema cache... creating GTK+ icon theme cache... building cache files for GTK+ input methods... building directory of Info manuals... building database for manual pages... building XDG desktop file cache... building XDG MIME database... building profile with 182 packages... real 19m0.126s user 0m5.648s sys 0m0.333s --8<---------------cut here---------------end--------------->8--- Most of the time remains spent after the message 'building profile with 182 package...'. That part seems IO-bound, with the spinning disks grinding heavily and the CPU mostly idling. The rest of the time (3 minutes), was used by the profile hooks. The same operation on a second, more modern machine equipped with M2 SSDs does much better and takes about 1 minute to accomplish the same, so it seems the bad performance can be mostly attributed to the much slower disk seek times of the spinning disks. On the older machine, two profile hooks are also sticking out w.r.t. the time they take (they take more than one minute opposed to a few seconds): --8<---------------cut here---------------start------------->8--- The following profile hook will be built: /gnu/store/08fanpydi7z4i3qnlqbr8iz23zdgsamw-manual-database.drv building database for manual pages... Creating manual page database... [2139/2139] building list of man-db entries... 175322 entries processed in 95.1 s successfully built /gnu/store/08fanpydi7z4i3qnlqbr8iz23zdgsamw-manual-database.drv successfully built /gnu/store/08fanpydi7z4i3qnlqbr8iz23zdgsamw-manual-database.drv /gnu/store/wzp4mk2r7r4ysciw74gqbfkyai0zmrcc-manual-database real 1m36.378s user 0m1.674s sys 0m0.108s The following profile hook will be built: /gnu/store/cir84qj587i6is4akgqand7ahg9bj938-xdg-mime-database.drv building XDG MIME database... successfully built /gnu/store/cir84qj587i6is4akgqand7ahg9bj938-xdg-mime-database.drv successfully built /gnu/store/cir84qj587i6is4akgqand7ahg9bj938-xdg-mime-database.drv /gnu/store/j0bznlj2ibnhirijhnwpkkxzz4qfk8wb-xdg-mime-database real 1m7.344s user 0m1.331s sys 0m0.053s --8<---------------cut here---------------end--------------->8--- So we should profile what's going on while generating the profile (no pun intended) and try to improve this at first since this is where most of the time is spent on spinning drives (17 minutes out of the 20 in the above example). After that we could look into the two above profile hooks. Thanks, Maxim