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

NixOS/nix.gc: Add optional randomized delay #98192

Closed
wants to merge 1 commit into from

Conversation

buckley310
Copy link
Contributor

Add an optional randomized delay to automatic garbage collection.
Syntax was copied from system.autoUpgrade.randomizedDelaySec

Motivation for this change

When dealing with virtual machines on shared storage, spreading this workload out over time is desirable.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@doronbehar
Copy link
Contributor

I don't see a benefit in the added option - If a user wants to configure this detail for their system, they can always set systemd.timers.nix-gc.timerConfig.RandomizedDelaySec by themselves.

@buckley310
Copy link
Contributor Author

It exposes the functionality in a slightly more friendly/documented way, and would provide some stability in case the systemd unit changed names or something like that (although I don't see a reason why it would). I don't have a really a great way to tell how many people would use this. If it turned out to be only me, then yeah, I agree it wouldn't make sense.

@stale
Copy link

stale bot commented Mar 19, 2021

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

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 19, 2021
@buckley310
Copy link
Contributor Author

Still interested.
If someone with clout thinks this is a bad idea, feel free to close.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 28, 2021
@buckley310
Copy link
Contributor Author

Closing, since nobody besides me seems interested, and this functionality is already possible, as mentioned above.

@buckley310 buckley310 closed this Apr 25, 2021
@buckley310 buckley310 deleted the gcdelay branch June 9, 2022 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants