Is your feature request related to a problem? Please describe.
We have the ability to configure jobs and cores, however, I would like to propose a third value, load-limit. This will allow for a machine-specific value to be passed to make's -l argument. Previously, we were just using the NIX_BUILD_CORES, but this isn't satisfactory, as machines which are configured to run many jobs will have a low core count set to avoid over-subscribing the available cores, and the low core value being set globally for all builds severely limits the throughput.
Describe the solution you'd like
I would like nix to recieve a --load-limit argument, as well as allow for a load-limit nix.conf value. And in a nix build environment having NIX_LOAD_LIMIT be set to the corresponding value.
In my opinion, the default value for load-limit should be:
max(($load-limit or system_cores), $cores)
or in English, "Take the load-limit value from nix.conf or passed as argument, if not available, then determine the system cores impurely. Take the the cores nix.conf or argument value if it's larger"
Describe alternatives you've considered
None which are satisfactory.
Additional context
Nixpkgs PRs:
Is your feature request related to a problem? Please describe.
We have the ability to configure
jobsandcores, however, I would like to propose a third value,load-limit. This will allow for a machine-specific value to be passed to make's-largument. Previously, we were just using theNIX_BUILD_CORES, but this isn't satisfactory, as machines which are configured to run many jobs will have a low core count set to avoid over-subscribing the available cores, and the low core value being set globally for all builds severely limits the throughput.Describe the solution you'd like
I would like nix to recieve a
--load-limitargument, as well as allow for aload-limitnix.conf value. And in a nix build environment havingNIX_LOAD_LIMITbe set to the corresponding value.In my opinion, the default value for
load-limitshould be:or in English, "Take the load-limit value from nix.conf or passed as argument, if not available, then determine the system cores impurely. Take the the
coresnix.conf or argument value if it's larger"Describe alternatives you've considered
None which are satisfactory.
Additional context
Nixpkgs PRs: