Skip to content

Proposal: use ctime of gc-roots instead of atime #3

@DavHau

Description

@DavHau

atime might be disabled on many systems and is also expensive.

How about a gc-roots with priorities based model? Tools like direnv, for example, already create gc-roots. Those could just touch the roots on each use. The garbage collector then just needs to delete all gc-root which haven't been used since 30days and do a standard garbage collect.

Advantages:

  • much cheaper in terms of IO
  • compatible to all file systems

Disadvantages:

  • relies on tools creating gc-roots and keeping them hot -> requires patching of tools

Alternatives:

An alternative approach that doesn't have the disadvantage mentioned above: Enable atime only on /nix/var/nix/gcroots and use those to determine the age of a gcroot. But now the downside is that this might require changing the partitioning scheme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions