[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guix --container is RAM hungry
From: |
Ricardo Wurmus |
Subject: |
Re: guix --container is RAM hungry |
Date: |
Tue, 26 Mar 2024 21:37:34 +0100 |
User-agent: |
mu4e 1.10.8; emacs 29.1 |
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