lix/src
Alex Wied 1af5d798a4 libstore/globals.cc: Automatically set cores based on cgroup CPU limit
By default, Nix sets the "cores" setting to the number of CPUs which are
physically present on the machine. If cgroups are used to limit the CPU
and memory consumption of a large Nix build, the OOM killer may be
invoked.

For example, consider a GitLab CI pipeline which builds a large software
package. The GitLab runner spawns a container whose CPU is limited to 4
cores and whose memory is limited to 16 GiB. If the underlying machine
has 64 cores, Nix will invoke the build with -j64. In many cases, that
level of parallelism will invoke the OOM killer and the build will
completely fail.

This change sets the default value of "cores" to be
ceil(cpu_quota / cpu_period), with a fallback to
std:🧵:hardware_concurrency() if cgroups v2 is not detected.
2022-07-19 16:03:58 -04:00
..
build-remote Generalize DerivationType in preparation for impure derivations 2022-03-18 14:59:56 +00:00
libcmd Merge pull request #6693 from ncfavier/complete-flake-inputs 2022-07-12 09:12:00 +02:00
libexpr Simplify the check for overrides on non-existent inputs 2022-07-13 13:40:40 +02:00
libfetchers fetchGit: document shallow argument 2022-06-26 12:00:00 +00:00
libmain Avoid fmt when constructor already does it 2022-04-19 01:44:11 +00:00
libstore libstore/globals.cc: Automatically set cores based on cgroup CPU limit 2022-07-19 16:03:58 -04:00
libutil Merge pull request #6693 from ncfavier/complete-flake-inputs 2022-07-12 09:12:00 +02:00
nix nix develop: do not assume that saved vars are set 2022-07-14 23:25:39 -07:00
nix-build nix-shell: restore backwards-compat with old nixpkgs 2022-06-13 23:29:28 +02:00
nix-channel Fix segfault in headerCallback() 2022-03-03 11:11:16 +01:00
nix-collect-garbage Add missing rethrows in conditional exception handlers 2022-06-10 10:52:41 -07:00
nix-copy-closure copyPaths: Pass store by reference 2021-07-22 09:59:51 +02:00
nix-env nix-env: A small std::move() optimization 2022-06-09 20:01:01 +05:30
nix-instantiate store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
nix-store nix-store: small std::move() optimization 2022-06-09 16:25:26 +05:30
resolve-system-dependencies Get rid of most .at calls (#6393) 2022-05-04 07:44:32 +02:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00