Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: garbage collect based on age #1680

Closed
LisannaAtHome opened this issue Nov 15, 2017 · 7 comments
Closed

Enhancement: garbage collect based on age #1680

LisannaAtHome opened this issue Nov 15, 2017 · 7 comments
Assignees
Labels

Comments

@LisannaAtHome
Copy link

The idea of "collecting garbage" is to delete things which aren't useful anymore, i.e., aren't likely to be used. The most direct heuristic for this is how long it's been since the last time something was used. For outputs that have no references (i.e., candidates for garbage collection), the ones that are used frequently (in builds) are less useful to garbage collect than the ones that haven't been used in a long time. So it seems logical that keeping track of the "age" of reference-less entries in the Nix store would be useful for implementing an option like:

gc-keep-recent = true|false
gc-recent = (time)

As a developer, I would personally find this very useful, and I'm sure others would as well.

@edolstra
Copy link
Member

Nix once had this feature but it was removed: 8824d60

@copumpkin
Copy link
Member

We could probably maintain times in the database rather than atimes. But I don't know if that causes a bunch of other annoyances.

@edolstra
Copy link
Member

edolstra commented Nov 15, 2017

Yeah, it would mean that every evaluation causes a huge number of updates in the database. Though I guess that could be done asynchronously.

@LisannaAtHome
Copy link
Author

LisannaAtHome commented Dec 9, 2017

@edolstra But doesn't NixOS still have relatime? Isn't that good enough?

@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 15, 2021
@bjornfor
Copy link
Contributor

😢

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/replacing-builtins-fetchtarball-with-pkgs-fetchfromgithub/18383/11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants