From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4D8FF8SWvWIs6wAAbAwnHQ (envelope-from ) for ; Thu, 30 Jun 2022 14:27:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id COCIFsSWvWJETQEAauVa8A (envelope-from ) for ; Thu, 30 Jun 2022 14:27:48 +0200 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 D6C7B11626 for ; Thu, 30 Jun 2022 14:27:47 +0200 (CEST) Received: from localhost ([::1]:54852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6tGs-0002mF-Rw for larch@yhetil.org; Thu, 30 Jun 2022 08:27:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6sWv-0005mu-HI for guix-devel@gnu.org; Thu, 30 Jun 2022 07:40:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6sWv-0007Kz-4Z; Thu, 30 Jun 2022 07:40:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=i879ZOVrSMEO5nfnuhpU8VKZ8+nRXjTxjQ8aA00Tflw=; b=OSR16+J+vy26N+kkisDh DIP7oHZTnURuUeKUzJCm4QxL+45ixqtkkeNrnxRjs2I01FebDA/RTJvjuCrWcKSrbcM0vBuOoxM5L Ed21k4Bj9oqHhOjdXB/gcCsHSNkct6T9hM3h43c5i7EDqfTMlhJxfay43F+PS5jE4THXNzz+6DeqT aTQoS1x8/UEZm/3TAzmersGyv5TozMIr7BHVpTb8iEOHpVNDRrP5djbyzOD70VKRvkMZqI8g9zA/r aZvqotiTiLRu7aTHHp8aYZWSbg6biVl1HmWRLCQwPW07P/Iq/ZAdz3civzivDO63yBWLPrIG/nZlb YZJYXm0rnNPVOw==; Received: from [193.50.110.235] (port=47640 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6sWs-0003Gv-H0; Thu, 30 Jun 2022 07:40:14 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Cc: guix-devel@gnu.org Subject: Re: Experimental nar-herder support for serving fixed output files by hash References: <87o7yilbnd.fsf@cbaines.net> <87mtdyjxnm.fsf@gnu.org> <87bkuel349.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 12 Messidor an 230 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour de l'Artichaut 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: Thu, 30 Jun 2022 13:40:12 +0200 In-Reply-To: <87bkuel349.fsf@cbaines.net> (Christopher Baines's message of "Mon, 27 Jun 2022 12:58:27 +0100") Message-ID: <878rpe8jmr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (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.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656592068; 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:dkim-signature; bh=i879ZOVrSMEO5nfnuhpU8VKZ8+nRXjTxjQ8aA00Tflw=; b=oheJl4loe/nouGrgCbD61I8r8ywYPwlHLTDzP9cEEzMRFmNuFVWfqPLA1FEBo6GPQz5ORJ SyzlJ9IcLVBKNLq0SEPorh+hrEUPsXHhZgkfVvt9xfhDUlntx/+Sf4Z9PQmEcAms3shJ1O fFIPgnWo882t79F2AtHnPPShDQv2azcu5ePDk/VtxFg/TjUWbPSGG2SWkMBSIfjLgmoRrh O2lm/HsIw6HBPwaBSwkSo2np+Wt3DR+fr4CxCThKfciaIfiUHdHUkXA+XcEEneOA8m0ZQ2 BQHDImCyc7NmEgDWJXRQgiP5t2Wdh2I52+UAVoTVgWDYPCxdKnU1PbQ4EBw0mw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656592068; a=rsa-sha256; cv=none; b=OQHCAtMp9snCY6gHExGDlr/ITERr5sptk6FKnw76pTcEOA4NsNoBrsrgJ0jpMlsXipFsyD ZHaJz8BXJ5xABZNvA9v+5adKMRJcsgUJJW7+9Sx4yf4kZNQbwFD10E+scFty1wp2Wb/Wme d5WrYnND5deLWaxzjy6T2Bo48grWSQ59vXmAsK1pk6fcdtHnkBk3FTwoe7U4DUraZ+gOQE 4qbQ8cRXhpZZPx0xXiwpcLtd4nZKyC9trFBOGiIY+VWThzMDIcfHDyfXXeSXaKhL3Rg9VK pJsl2MIkhevuLH0lUoBU+We7TNw6f7uOLzkiPgH9qGVkQMoUGr3PoyGNIwWXqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=OSR16+J+; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.65 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=OSR16+J+; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D6C7B11626 X-Spam-Score: -3.65 X-Migadu-Scanner: scn1.migadu.com X-TUID: CvMo9/RhfOkt Hi, Christopher Baines skribis: > Ludovic Court=C3=A8s writes: > >>> The code isn't great, there's some difficulty in extracting the single >>> file from the nar, but the biggest problem is a limitation in the guile >>> fibers web server. Currently, responses have to be read in to memory, >>> which is fine for we pages, but not great if you're trying to serve >>> files which can be multiple gigabytes in size. This also means that the >>> first byte of the response is available when all the bytes are >>> available, so the download is slow to start. >> >> That, and in practice a cache (with some eviction mechanism) would be >> necessary so nars don=E2=80=99t need to be extracted every time and so w= e can >> use sendfile(2). > > I'd actually imagined that this would be used infrequently, but yeah, if > the decompression does become a bottleneck, then some caching reverse > proxy could help reduce that. Relying on a proxy may be insufficient, because you still have incoming requests that can trigger unbounded peaks of I/O and CPU usage, and these requests may not be satisfied in time (the client may hang up before the server is done processing the nar.) >> IWBN to share as much code as possible with =E2=80=98guix publish=E2=80= =99, which has >> great test suite coverage and is being hammered every day. Clearly the >> bit about extracting nars is specific to the nar-herder though, so that >> may prove difficult. > > I'm going to look at the Guile Fibers web server, hopefully that can be > improved to support streaming responses, which would allow removing a > lot of custom code from guix publish. By =E2=80=9Cstreaming responses=E2=80=9D, do you mean pipelining? How would that affect =E2=80=98guix publish=E2=80=99? > There isn't all that much code to the nar-herder though, and most of > waht is there is doing different things to guix publish, so I'm not sure > there's all that much to share. > > What I was getting at here though, ignoring the implementation, was > whether this is worthwhile to do? As in, is there benefit to having this > and being able to extend the content addressed mirrors that Guix uses? Having more content-addressed mirrors is worthwhile IMO, yes. Having two different implementations of the same interfaces may not be ideal, though, in terms of long-term maintenance cost. Thanks, Ludo=E2=80=99.