Skip to content

Commit 5d7fc37

Browse files
committed
docs: document --max-memory-size option for eval OOM workaround
depends on #2061
1 parent e5eb322 commit 5d7fc37

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nix/docs/nix-build-matrix-ci.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ You can see the available runners and their associated labels on [this page](htt
2828

2929
**A:** The evaluation can be quite costly memory-wise. [nix-eval-jobs](https://github.com/NixOS/nix-eval-jobs) is spinning up multiple nix evaluation in parallel to speed things up. The tradeoff is an increased memory consumption compared to a single-process eval.
3030

31-
An easy way to go around a eval OOM issue is to reduce the number of parallel evals by overriding the `--nb-eval-jobs-workers` flag from the github_matrix call in the `github/workflows/nix-eval.yml` file.
31+
There are two ways to reduce memory consumption, both configurable from the `github_matrix` call in `github/workflows/nix-eval.yml`.
3232

33-
IE. replace
33+
**Reduce the number of parallel workers** by overriding `--nb-eval-jobs-workers`. By default, `github_matrix.py` spins up one eval instance per CPU. For a `blacksmith-32vcpu-ubuntu-2404` worker, that means 32 nix eval instances.
3434

3535
```terminal
36-
nix run --accept-flake-config .\#github-matrix -- checks legacyPackages
36+
nix run --accept-flake-config .\#github-matrix -- --nb-eval-jobs-workers 16 checks legacyPackages
3737
```
3838

39-
with:
39+
**Reduce the per-worker memory limit** by overriding `--max-memory-size` (in MiB). The default is 3072 (3 GiB). Lowering this value causes nix-eval-jobs to restart workers that exceed the threshold, trading evaluation speed for lower peak memory usage.
4040

4141
```terminal
42-
nix run --accept-flake-config .\#github-matrix -- --nb-eval-jobs-workers 30 checks legacyPackages
42+
nix run --accept-flake-config .\#github-matrix -- --max-memory-size 2048 checks legacyPackages
4343
```
4444

45-
Note: by default, the `github_matrix.py` will spin up a eval instance per CPU. For a `blacksmith-32vcpu-ubuntu-2404` worker, it means it'll spin up 32 nix eval instances.
45+
Both flags can be combined for tighter control over total memory consumption.
4646

4747
## Walkthrough the CI
4848

0 commit comments

Comments
 (0)