Passing `-l$NIX_BUILD_CORES` improperly limits the overall system load.
For a build machine which is configured to run `$B` builds where each
build gets `total cores / B` cores (`$C`), passing `-l $C` to make will
improperly limit the load to `$C` instead of `$B * $C`.
This effect becomes quite pronounced on machines with 80 cores, with
40 simultaneous builds and a cores limit of 2. On a machine with this
configuration, Nix will run 40 builds and make will limit the overall
system load to approximately 2. A build machine with this many cores
can happily run with a load approaching 80.
A non-solution is to oversubscribe the machine, by picking a larger
`$C`. However, there is no way to divide the number of cores in a way
which fairly subdivides the available cores when `$B` is greater than
1.
There has been exploration of passing a jobserver in to the sandbox,
or sharing a jobserver between all the builds. This is one option, but
relatively complicated and only supports make. Lots of other software
uses its own implementation of `-j` and doesn't support either `-l` or
the Make jobserver.
For the case of an interactive user machine, the user should limit
overall system load using `$B`, `$C`, and optionally systemd's
cpu/network/io limiting features.
Making this change should significantly improve the utilization of our
build farm, and improve the throughput of Hydra.
optifinePackages.optifine-latest: 1.18.1_HD_U_H4 -> 1.19.2_HD_U_H9
optifinePackages.optifine_1_19_2: init at 1.19.2_HD_U_H9
optifinePackages.optifine_1_19_1: init at 1.19.1_HD_U_H9
optifinePackages.optifine_1_19: init at 1.19_HD_U_H9
optifinePackages.optifine_1_18_2: init at 1.18.2_HD_U_H7
optifinePackages.optifine_1_18_1: 1.18.1_HD_U_H4 -> 1.18.1_HD_U_H6
optifinePackages.optifine_1_18: init at 1.18_HD_U_H3
optifinePackages.optifine_1_16_4: init at 1.16.4_HD_U_G7
optifinePackages.optifine_1_16_3: init at 1.16.3_HD_U_G5
optifinePackages.optifine_1_16_2: init at 1.16.2_HD_U_G5
optifinePackages.optifine_1_16_1: init at 1.16.1_HD_U_G2
optifinePackages.optifine_1_15_2: 1.16.5_HD_U_G8 -> 1.15.2_HD_U_G6
optifinePackages.optifine_1_14_3: init at 1.14.3_HD_U_F2
optifinePackages.optifine_1_14_2: init at 1.14.2_HD_U_F1
optifinePackages.optifine_1_13_1: init at 1.13.1_HD_U_E4
optifinePackages.optifine_1_13: init at 1.13_HD_U_E4
optifinePackages.optifine_1_12_1: init at 1.12.1_HD_U_G5
optifinePackages.optifine_1_12: init at 1.12_HD_U_G5
optifinePackages.optifine_1_11: init at 1.11_HD_U_G5
optifinePackages.optifine_1_10_2: init at 1.10.2_HD_U_I5
optifinePackages.optifine_1_9_2: init at 1.9.2_HD_U_E3
optifinePackages.optifine_1_9_0: init at 1.9.0_HD_U_I5
optifinePackages.optifine_1_8_8: init at 1.8.8_HD_U_I7
optifinePackages.optifine_1_8_0: init at 1.8.0_HD_U_I7
optifinePackages.optifine_1_7_2: init at 1.7.2_HD_U_F7