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
influxdb (on nixos): reduce closure size by 99.99% (and a bit) #28127
Conversation
@@ -68,7 +68,7 @@ let | |||
|
|||
collectd = [{ | |||
enabled = false; | |||
typesdb = "${pkgs.collectd}/share/collectd/types.db"; | |||
typesdb = "${cfg.collectdPackage}/share/collectd/types.db"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a use-case for not using the data-only variant? If not, maybe just do that, at least for the initial version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll do that. There is really only one collectd package anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any thoughts on the multiple outputs alternative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinion on it. Conceptually I think multiple-outputs is cleaner but not sure if there are any practical benefits in this case.
Is it possible to deploy collectd
without the data? If so, that'd be a good case for moving the data to a separate output. Another thing to consider is that without hardlinking optimization you'd waste quite a bit of space if both the data-only and the full collectd paths end up being referenced by a gc root.
I would prefer to use multiple outputs here if collectd still works or we can make it work with the data being in another output. But this approach is also fine for now. 👍 |
I've updated the PR to just reference |
Motivation for this change
The influxdb nixos module pulls in
collectd
in order to fetch a single file which pulls in a number of other things (java, gtk and loads more).This PR creates a separate derivation for the just the data bits and makes it configurable for influxdb.
Closure size before: 897M
Closure size after: 36K
My question is - should we instead change the collectd derivation to properly use multiple outputs and then stick the data bits in there instead of making the separate
collectd-data
derivation?@joachifm @fpletz
Things done
Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)