unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: raingloom@riseup.net
Cc: Edouard Klein <edou@rdklein.fr>, guix-devel@gnu.org
Subject: Re: guix --container is RAM hungry
Date: Tue, 26 Mar 2024 21:37:34 +0100	[thread overview]
Message-ID: <874jcsd8lq.fsf@elephly.net> (raw)
In-Reply-To: <9f5fb6729e8a3ab6756e923ce1c6e194@riseup.net>


raingloom@riseup.net writes:

> On 2024-03-21 22:44, Edouard Klein wrote:
>> Dear Guixers,
>> 
>> I'm a huge fan of guix --container, and I created a system to use those
>> by default for network services. But the VPS these services run on has
>> only 2GB of RAM, and I just realized that a container, by default,
>> requires at least 200MB.
>> 
>> Try it:
>> guix shell time which -- bash -c "$(which time) -v guix shell
>> --container"
>> 
>> Then Ctrl-D, and look for this line:
>> 	Maximum resident set size (kbytes): 291300
>> 
>> 291MB of RAM to run bash.
>> 
>> 
>> By contrast, removing the --container option from above yields:
>> 	Maximum resident set size (kbytes): 64496
>> 
>> 64MB, still a lot, but I can live with that.
[...]
> My first guess is that the Guile process is hanging around waiting for
> the process it launched, instead of exec-ing into it directly.

In (@@ (guix scripts environment) launch-environment) we use execlp;
launch-environment is used by both launch-environment/fork as well as
launch-environment/container.  There is, however, an awful lot of
forking going on.

launch-environment/container uses call-with-container, which ends in
using launch-environment.  call-with-container forks, and
launch-environment also forks.

The Guile process that was started when launching Guix probably doesn't
get replaced in this case, as raingloom guessed.

-- 
Ricardo


  reply	other threads:[~2024-03-26 20:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 21:44 guix --container is RAM hungry Edouard Klein
2024-03-25  9:27 ` raingloom
2024-03-26 20:37   ` Ricardo Wurmus [this message]
2024-03-28 23:30 ` Ludovic Courtès
2024-03-30  2:33   ` Maxim Cournoyer
2024-04-02 20:33     ` Edouard Klein
2024-04-10 14:02       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jcsd8lq.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=edou@rdklein.fr \
    --cc=guix-devel@gnu.org \
    --cc=raingloom@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).