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

Open
wants to merge 1 commit into
base: master
from

Conversation

@buckley310
Copy link
Contributor

@buckley310 buckley310 commented Sep 18, 2020

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.
@buckley310 buckley310 force-pushed the buckley310:gcdelay branch from 84316ff to 3ff6706 Sep 18, 2020
@doronbehar
Copy link
Contributor

@doronbehar doronbehar commented Sep 19, 2020

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

@buckley310 buckley310 commented Sep 20, 2020

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.

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.