From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0OMsOIHuZmb9FwAA62LTzQ:P1 (envelope-from ) for ; Mon, 10 Jun 2024 12:16:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 0OMsOIHuZmb9FwAA62LTzQ (envelope-from ) for ; Mon, 10 Jun 2024 14:16:01 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718021761; a=rsa-sha256; cv=none; b=HcSlvfKoMz8xI9rnI3zuwQVS4wsVx7+FSXuRrdhYrNAnM/bIumh15EdAnEJ2tfnlSZpuZU d+SdNx7yue3ld78hVU97Kzz5rc+XJEtUDnddQBSSRxWhLWTstVfTDutFxhYXGzitLAQjVR 9j81iaXT9brL5TdF1y9p9hPSqazzpLP9toL4eVdM7S1ieRnbB34I3ZpyxbxbN5jBv3VYWE R5zrBQBf7aZHHqGX8eDRhNaMI5a/StKXFRLDCYA4jQ8bYJCEFxRICLrPPew30ai3qs4kbi lUGSni3vRXB9j5ta5MVN4vdaNfC+HqKvuFhjIRbElOcwYVbPQF72J8ESBJW+xA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718021761; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=zPHXDGz12K6jIPe9vmjsxMM5DuXtO9CPLnX+uWeYXzU=; b=LRCGPPilbckMZI5FBOt5NyZyTNPDVwMgFbafU6EGG/dW16+wmBCq/fOLlfjMYGN7ujzXIJ zyxivJAyihJdXb5bjubS18Jiqa6PCCqwDv9Z7AKkGFy2p1SdQ2aTiM55jDa6otRWTdwCZR xvcuJ3N95Xp3zp31GrNBnjU9LjXAOVSubZtEHYccQpntM+p1oqaaz9G6Jw1q4TO3Ivnhrd O1tDFmocEPC/ulXm7tYbiFne1Gf4REp+QpH+9tcnSnUoDM4epu2ElSFitf/NSEUXcamPOq c0yFJ3hCqZqNwKfmc/K4zj7HyclkrRxGNFFT6RQ9nCZHpY5fnlE840wMyXnhMw== 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 D33C065805 for ; Mon, 10 Jun 2024 14:16:01 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGdwD-0004DV-MC; Mon, 10 Jun 2024 08:15:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGdwA-0004B9-0g for guix-patches@gnu.org; Mon, 10 Jun 2024 08:15:47 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGdw9-0004cv-Df for guix-patches@gnu.org; Mon, 10 Jun 2024 08:15:45 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sGdwQ-0003K8-3o for guix-patches@gnu.org; Mon, 10 Jun 2024 08:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71357] [PATCH] substitute: =?UTF-8?Q?Don=E2=80=99t?= keep cache entries more than a few days. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 10 Jun 2024 12:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71357 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 71357@debbugs.gnu.org, Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , Christopher Baines Received: via spool by 71357-submit@debbugs.gnu.org id=B71357.171802175812758 (code B ref 71357); Mon, 10 Jun 2024 12:16:02 +0000 Received: (at 71357) by debbugs.gnu.org; 10 Jun 2024 12:15:58 +0000 Received: from localhost ([127.0.0.1]:58487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGdwL-0003Jg-VK for submit@debbugs.gnu.org; Mon, 10 Jun 2024 08:15:58 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGdwJ-0003JT-LP for 71357@debbugs.gnu.org; Mon, 10 Jun 2024 08:15:56 -0400 Received: from localhost (unknown [212.132.255.10]) by mira.cbaines.net (Postfix) with ESMTPSA id AC40227BBE2; Mon, 10 Jun 2024 12:57:50 +0100 (BST) Received: from felis (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 107bf1b3; Mon, 10 Jun 2024 11:57:50 +0000 (UTC) From: Christopher Baines In-Reply-To: <40bd5a0087d54531aabe2d0ce8d0cd2a6bd7e547.1717487258.git.ludo@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 4 Jun 2024 10:06:43 +0200") References: <40bd5a0087d54531aabe2d0ce8d0cd2a6bd7e547.1717487258.git.ludo@gnu.org> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Mon, 10 Jun 2024 12:57:48 +0100 Message-ID: <87bk49c8n7.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: D33C065805 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.94 X-Spam-Score: -6.94 X-TUID: Es74vRUL6EyN --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Experience has shown that keeping too many entries increases disk usage > and, more importantly, leads to long delays when cleaning up the cache, > measured in minutes on slow or busy HDDs with hundreds of thousands of > cache entries, as is common on build machines. In those cases, the cost > of the cache outweighs its benefit. > > * guix/scripts/substitute.scm (%narinfo-expired-cache-entry-removal-delay= ): > Reduce to 5 days. > (cached-narinfo-expiration-time)[max-ttl]: Reduce to 2 days. > > Change-Id: Iab212f572ee9041be61716423a3c014f93fe81ed > --- > guix/scripts/substitute.scm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > Hello, > > Chris mentioned it before and I experienced it the hard way on bayfront: > > https://lists.gnu.org/archive/html/guix-devel/2024-05/msg00177.html > > A big narinfo cache is a significant performance hit on spinning HDDs > when the time comes to remove expired entries. > > This change makes the cache more ephemeral (2 to 5 days). I still think > some caching is needed: one will often run several Guix commands in a > day that will query the same narinfos and will only download/build a > small subset (keep in mind that that =E2=80=98substitution-oracle=E2=80= =99, used by > =E2=80=98derivation-build-plan=E2=80=99, query narinfos for the closure o= f the requested > derivations, minus those already valid); it would be wasteful and > inefficient to download them over and over again. I=E2=80=99d like to ha= ve > metrics to estimate that, but I don=E2=80=99t. > > Thoughts? This sounds good to me. I think one of the problems on bayfront is that each substitute process looks and decides it's time to remove the expired cache entries. For every new process that starts and decides to join it, it probably slows them all down. This is very similar to a "thundering herd" since the processes trip over each other trying to delete the same files. This change won't directly address that part of the issue, but maybe keeping the cache smaller will help reduce the impact when this happens. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmZm6jxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xdn3A//Wv8H/50AGHscERH2adhZlMupXvAqNm7L mQTsJa29YpQ9ujoc61L6fTuz9vhVCgRYrM90RsowOlW4D7WkL9r0F9zDyZmlT9+h uIIBV/2OmVbfuTmSZVcvHqoAwVT/Po8MPvB8ywRrlcDbcG6CvZszEWJvKVIIjM66 dhcm11yjSouTrzkFY/vQIHWYbgWICLDAzK+ReZOW1HZGfOTClVdbYMAj+oLttIll +rZylp/EpM9Es++KYnJ4+FuevX914ewW8h+Xj8OlBNRL6cikS6xb3/7bIShOlxo2 OfaH1tIWUW3OfoD9r5PuoiC9LnO8UPLRDLGMivpt9X/4rxiNTJ5875O4QF7t4c3I vmTFeUmbSmEo6ivAUcivIq1PMdxCssuGo5v2GOHfhAgowxf+Xib3ld58jSGaMKFv tvQr6yOzseFwMbbLwijN8SDasWuPCy47XcSdZmRytAuDJTRiHVtQm1WU3ssqS/ga rfeV7xBvHzDOXLqA4WCGBT2opROk77P/zgDZCFGvYlwbUNanlw/2/zss2qE+MWkl YSK9ZTQQdqVFUQZUpwDBfnTW8uDH/TOXdzwaVMPu7TbwzJyXRyZ1ScW62IKzwDq5 A2q56EiNLgpJhsIwYo8AKoYoAtJNRU5WKBGlHHkKpjaPAl7a5dE87OsEkCqjElBw Vfex2Sw8XNs= =R2nE -----END PGP SIGNATURE----- --=-=-=--