unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Provide an option to specify the tmpfs size of the container
@ 2020-12-09 13:58 luhux
  2020-12-14  9:56 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: luhux @ 2020-12-09 13:58 UTC (permalink / raw)
  To: guix-devel


Hello everyone

I am using guix environment --container to containerize my programming environment and runtime environment, but I found that the container / created 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?

thanks

luhux


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Provide an option to specify the tmpfs size of the container
  2020-12-09 13:58 Provide an option to specify the tmpfs size of the container luhux
@ 2020-12-14  9:56 ` Ludovic Courtès
  2020-12-22  5:57   ` Robert Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2020-12-14  9:56 UTC (permalink / raw)
  To: luhux; +Cc: guix-devel

Hi,

luhux <luhux@outlook.com> skribis:

> I am using guix environment --container to containerize my programming environment and runtime environment, but I found that the container / created 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?

Sure, why not.  Would you like to give it a try?

In the meantime, you can use ‘--share’ so the logs are stored on disk.

Thanks,
Ludo’.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Provide an option to specify the tmpfs size of the container
  2020-12-14  9:56 ` Ludovic Courtès
@ 2020-12-22  5:57   ` Robert Smith
  2021-01-21 11:02     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Smith @ 2020-12-22  5:57 UTC (permalink / raw)
  To: Ludovic Courtès, luhux; +Cc: guix-devel

Hi Ludo,

On Mon Dec 14, 2020 at 10:56 AM Ludovic Courtès wrote:
> Hi,
> 
> luhux <luhux@outlook.com> skribis:
> 
> > I am using guix environment --container to containerize my programming environment and runtime environment, but I found that the container / created 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?
> 
> 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=' 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. 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.

-Robert



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Provide an option to specify the tmpfs size of the container
  2020-12-22  5:57   ` Robert Smith
@ 2021-01-21 11:02     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2021-01-21 11:02 UTC (permalink / raw)
  To: Robert Smith; +Cc: guix-devel

Hi,

"Robert Smith" <robertsmith@posteo.net> skribis:

> On Mon Dec 14, 2020 at 10:56 AM Ludovic Courtès wrote:
>> Hi,
>> 
>> luhux <luhux@outlook.com> skribis:
>> 
>> > I am using guix environment --container to containerize my programming environment and runtime environment, but I found that the container / created 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?
>> 
>> 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=' 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 ‘mount-file-systems’ 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’d use ‘--share’ 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’.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-21 11:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 13:58 Provide an option to specify the tmpfs size of the container luhux
2020-12-14  9:56 ` Ludovic Courtès
2020-12-22  5:57   ` Robert Smith
2021-01-21 11:02     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).