From 24de2b34abcc8604fe8f1dc78356247343760156 Mon Sep 17 00:00:00 2001 From: FrozenPandaz Date: Fri, 13 Jan 2023 17:25:00 -0500 Subject: [PATCH] fix(core): cap inferred max workers count at 8 --- packages/nx/src/project-graph/build-project-graph.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nx/src/project-graph/build-project-graph.ts b/packages/nx/src/project-graph/build-project-graph.ts index 2e67d3977a70c..31296c88dd32d 100644 --- a/packages/nx/src/project-graph/build-project-graph.ts +++ b/packages/nx/src/project-graph/build-project-graph.ts @@ -400,7 +400,7 @@ function buildExplicitDependenciesUsingWorkers( function getNumberOfWorkers(): number { return process.env.NX_PROJECT_GRAPH_MAX_WORKERS ? +process.env.NX_PROJECT_GRAPH_MAX_WORKERS - : os.cpus().length - 1; + : Math.min(os.cpus().length - 1, 8); // This is capped for cases in CI where `os.cpus()` returns way more CPUs than the resources that are allocated } function createContext(