unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Pierre Neidhardt <ambrevar@gmail.com>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: guix gc: smarter collection & guix.el manual deletion
Date: Sun, 29 Jul 2018 05:06:34 -0700	[thread overview]
Message-ID: <87k1pekzzp.fsf@gmail.com> (raw)
In-Reply-To: 87effnejrg.fsf@gmail.com

[-- Attachment #1: Type: text/plain, Size: 3063 bytes --]

Pierre Neidhardt <ambrevar@gmail.com> writes:

>> Perhaps you simply don't have enough garbage available for the collector
>> to collect?  If you ask for 5 GiB, your system has 3 GiB free, and there
>> is only 1 GiB of garbage, the best the collector can do is collect all
>> the garbage (1 GiB) and leave you with just 4 GiB of free space.
>
> Sorry for the sparse details, I forgot to mention that if I run `guix gc -F8GB`,
> then I get 5-6GB back, so it _can_ remove that much garbage indeed! ;)

The "guix gc" command appears to be working correctly for me:

--8<---------------cut here---------------start------------->8---
[0] marusich@garuda.local:~
$ df -h /gnu/store
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/encrypted-root  211G  194G  5.8G  98% /gnu/store
[0] marusich@garuda.local:~
$ guix gc -F8G
guix gc: freeing 2,336.80469 MiBs
finding garbage collector roots...
deleting garbage...
[...]
deleted or invalidated more than 2450317312 bytes; stopping
[...]
[0] marusich@garuda.local:~
$ df -h /gnu/store
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/encrypted-root  211G  187G   13G  94% /gnu/store
--8<---------------cut here---------------end--------------->8---

Above, I began with 5.8 GiB of free space in the store's file system.  I
asked Guix to increase that value to 8 GiB.  Guix correctly determined
that it would need to free approximately 8 - 5.8 = 2.2 GiB or more to
fulfill my request.  It then started collecting garbage and stopped once
it found that it had freed slightly more space than required.  I ended
with 13 GiB of free space.  Since I asked Guix to collect enough garbage
to end up with at least 8 GiB of free space, Guix behaved correctly.

Before you run "guix gc" next time, first see how much garbage you have:

--8<---------------cut here---------------start------------->8---
[0] marusich@garuda.local:~
$ guix gc --list-dead | tr '\n' '\0' | du -hsc --files0-from - | tail -n 1
finding garbage collector roots...
determining live/dead paths...
70G	total
--8<---------------cut here---------------end--------------->8---

Above, dead paths take up 70 GiB of space in my store.  However, even if
Guix collects all of those dead paths, it might not actually free up 70
GiB of space.  This is because of deduplication.  If a dead path and a
live path have been deduplicated, it means they had the same content and
Guix saved space by converting them to hard links pointing to the same
inode.  In that case, the amount of space Guix can free is strictly less
than 70 GiB, since Guix has to keep the deduplicated storage around for
the sake of the live path.

In any case, if the current free space plus the space taken up by the
dead paths is less than the amount of free space you requested via the
-F option, then Guix will collect all the garbage, but you'll definitely
end up with less free space than you asked for.

Hopefully this will help to explain the behavior you're seeing.

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-07-29 12:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26  7:49 guix gc: smarter collection & guix.el manual deletion Pierre Neidhardt
2018-07-27  9:52 ` Chris Marusich
2018-07-27 19:42   ` Pierre Neidhardt
2018-07-28 10:17     ` Chris Marusich
2018-07-28 10:29       ` Pierre Neidhardt
2018-07-29 12:06         ` Chris Marusich [this message]
2018-07-29 17:33           ` Pierre Neidhardt
2018-07-29 17:48           ` Efraim Flashner
2018-07-29 18:01             ` Pierre Neidhardt
2018-07-29 23:37         ` Ludovic Courtès
2018-07-30  6:54           ` Pierre Neidhardt
2018-07-28  9:21 ` Chris Marusich
2018-07-28  9:57   ` Pierre Neidhardt

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=87k1pekzzp.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=ambrevar@gmail.com \
    --cc=guix-devel@gnu.org \
    /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).