From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mD1hD3FfCWD9LgAA0tVLHw (envelope-from ) for ; Thu, 21 Jan 2021 11:03:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WEU0C3FfCWBNAgAAB5/wlQ (envelope-from ) for ; Thu, 21 Jan 2021 11:03:13 +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 C03A69403E6 for ; Thu, 21 Jan 2021 11:03:12 +0000 (UTC) Received: from localhost ([::1]:55890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2Xk7-0005MA-L2 for larch@yhetil.org; Thu, 21 Jan 2021 06:03:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2Xjk-0005Lv-D2 for guix-devel@gnu.org; Thu, 21 Jan 2021 06:02:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40235) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2Xjj-0004kb-QU; Thu, 21 Jan 2021 06:02:47 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=47400 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l2Xjj-0000hd-8s; Thu, 21 Jan 2021 06:02:47 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: "Robert Smith" Subject: Re: Provide an option to specify the tmpfs size of the container References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 =?utf-8?Q?Pluvi=C3=B4se?= 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: Thu, 21 Jan 2021 12:02:45 +0100 In-Reply-To: (Robert Smith's message of "Mon, 21 Dec 2020 21:57:06 -0800") Message-ID: <87h7nablii.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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.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 Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.85 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: C03A69403E6 X-Spam-Score: -2.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: wuQy4KKTYlWv Hi, "Robert Smith" skribis: > On Mon Dec 14, 2020 at 10:56 AM Ludovic Court=C3=A8s wrote: >> Hi, >>=20 >> luhux skribis: >>=20 >> > I am using guix environment --container to containerize my programming= environment and runtime environment, but I found that the container / crea= ted by this command uses tmpfs and cannot be resized. >> > >> > When a file in the container outputs a lot of logs to the tmpfs of the= container, the memory usage of the host will be very high (this is usually= something I did not expect) >> > >> > So can provide an option to specify the size of tmpfs? >>=20 >> Sure, why not. Would you like to give it a try? > > This feature caught my interest and I wanted to investigate a bit :) > tmpfs defaults to half of the available RAM, with the 'size=3D' option to > the mount command we can increase this limit but I believe that the > upper bound is the sum of the available RAM + swap space. OK. > Would it be worthwhile to allow for the container filesystem to be > stored in a non-temporary filesystem, for example allowing the user to > specify the parent directory of the container root? This would let the > container fs grow as large as the computer storage allows. Yes. This happens in =E2=80=98mount-file-systems=E2=80=99 in (gnu build linux-container): ;; The container's file system is completely ephemeral, sans directories ;; bind-mounted from the host. (mount "none" root "tmpfs") So we can change it and make sure the temporary root directory is cleaned up afterwards. The only use case where this might be useful is log files, as luhux reported, since in cases where you want to preserve data, you=E2=80=99d use =E2=80=98--share=E2=80=99 instead. The downside of not using a tmpfs is that data written to the file system is visible outside the container, in /tmp/guix-directory.XXX, though that directory is 700. Thanks, Ludo=E2=80=99.