From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4MpzJ6P0gWCYRgAAgWs5BA (envelope-from ) for ; Fri, 23 Apr 2021 00:11:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0BDoIqP0gWDlDAAAbx9fmQ (envelope-from ) for ; Thu, 22 Apr 2021 22:11:47 +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 4D8C41BC06 for ; Fri, 23 Apr 2021 00:11:47 +0200 (CEST) Received: from localhost ([::1]:58016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZhY2-0000j2-GT for larch@yhetil.org; Thu, 22 Apr 2021 18:11:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZhXu-0000iu-BM for guix-devel@gnu.org; Thu, 22 Apr 2021 18:11:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57992) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZhXu-0003Rr-1h; Thu, 22 Apr 2021 18:11:38 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38408 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lZhXp-0004Jg-Rp; Thu, 22 Apr 2021 18:11:37 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: Narinfo negative and transient error caching References: <87mtvhnsn6.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 =?utf-8?Q?Flor=C3=A9al?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=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: Fri, 23 Apr 2021 00:11:31 +0200 In-Reply-To: <87mtvhnsn6.fsf@cbaines.net> (Christopher Baines's message of "Fri, 05 Mar 2021 22:27:09 +0000") Message-ID: <874kfyufzg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, 47897@debbugs.gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619129507; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=a5sSDMm38mdSsNaxV2xFlXK7SI2Ym+VWi4Zl20+1Leg=; b=Ric/MNE+Y/6xshSJBy5pVej7gdF1yBEbMdY6MkU/34CTSNWIYq4MLYKe2W0U27hepf2FPq DjN0RhIiedqOBP1ePWOowyyWzZQdGqrWh4IDrgd7021BewoLOV1RbsCPen+XW1V05JC218 OQas0ltB6MgB8AWTDUw3Q45ICCb7aHX5yoDGchMk1422+Mlu/4vPUHs84eJXYaVcRQhl4E A0s+vf2kk+g50JNmZnr1Qj5t7Uwe/MrAJfJDPTojJTznhlj2HI4i01smdxnDJuhmqmIKMH 1NuR3gHB1nkJlB/v1D7+fzgVb05gD4MkwqJeKklpA1WlkCQiLoS7xosCuimdBg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619129507; a=rsa-sha256; cv=none; b=e8y3fRv0HzbpMbIHZMaC0GJgJLorQqLsxHuY5A5BIeDCKyvpWjyY2vQL1xO6KM3NcUn7UV zcb5Z7Y5UoZTObC33OkPY9hFDfnnccoyditmT9F8WYsyk+K7Q+XrDkVtdM29du5xq2rNUZ xTJiigpHED8HnNlrVKrmMyNQB0Bk88uefXJcXLtDN1FXsVzdC+y00/m+sCmYasJReZXgwS XvTQrWrAfTcuB2CIKGGQRCbqdK0HVpHRaalk4BpP/phR4/jAvvKHhLIpsWDEjLt/iGoBH5 BEQ3yBT51EX8I961F3JX+RxrWXHauLKJxEOCEsz6iGJxiZO7uvJQaYu7JOsU/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.95 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 4D8C41BC06 X-Spam-Score: -2.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: HykafsncQHnX Hi! (=E2=80=9CSorry for the long delay=E2=80=9D is officially my motto at this = point.) Christopher Baines skribis: > This has been on my mind for a while, as I wonder what effect it has on > users fetching substitues. > > The narinfo caching as I understand it works as follows: > > Default success TTL =3D> 36 hours > Negative TTL =3D> 1 hour > Transient error TTL =3D> 10 minutes > > I'm ignoring the success TTL, I'm just interested in the negative and > transient error values. Negative means that when a server says it > doesn't have an output, that response will be cached for an > hour. Transient errors are for other HTTP response codes, like 504. You=E2=80=99re looking at the default TTLs, which are not the actual TTLs. Specifically, servers can include a =E2=80=98Cache-Control=E2=80=99 header = in their reply specifying the TTL of their choice, and =E2=80=98guix substitute=E2= =80=99 honors that: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/substitutes.scm#n200 https://git.savannah.gnu.org/cgit/guix.git/tree/guix/scripts/publish.scm#= n371 =E2=80=98guix publish=E2=80=99 returns 404 with a TTL of 5mn when the reque= sted item is in store but needs to be =E2=80=9Cbaked=E2=80=9D. However, =E2=80=98guix publish=E2=80=99 does not set =E2=80=98Cache-Control= =E2=80=99 when the request item is not in store. In that case, clients use =E2=80=98%narinfo-negative= -ttl=E2=80=99 (1h). > I had a look through the Git history, caching negative lookups has been > a thing for a while. Caching transient errors was added, but I couldn't > see why. Transient error caching was most likely added in the days of hydra.gnu.org, that VM that was extremely slow. When overloaded, you=E2=80= =99d get 500 or similar, and at that point it was safer for clients to wait and come back later, possibly much later. :-) > Personally I don't see a reason to keep either behaviours? The main arguments for these negative TTLs are: 1. Reducing server load: if the server doesn=E2=80=99t have libreoffice, = don=E2=80=99t come back asking every 10s, it=E2=80=99s prolly useless. You could ea= sily have =E2=80=9CGET storms=E2=80=9D for libreoffice if clients don=E2=80= =99t restrain themselves. 2. Improving client performance: don=E2=80=99t GET things that are likely= to fail. Now, the penalty it imposes is annoying. I=E2=80=99ve sometimes found myse= lf working around it, too (because I knew the server was going to have the store item sooner than 1h). Rather than removing it entirely, I can think of these options: 1. Reduce the default negative timeouts. 2. Add an option to =E2=80=98guix publish=E2=80=99 (and to the Coordinato= r?) so they send a =E2=80=98Cache-Control=E2=80=99 header with the chosen TTL on 4= 04. That way, if the server operator doesn=E2=80=99t mind extra load, they can = run =E2=80=9Cguix publish --negative-ttl=3D0=E2=80=9D. WDYT? Does that make any sense? Ludo=E2=80=99.