Skip to content

Commit

Permalink
Merge pull request #27052 from storybookjs/norbert/lower-cpu-usage-ci
Browse files Browse the repository at this point in the history
Build: Max of 5 concurrent tasks on CI
  • Loading branch information
ndelangen authored May 7, 2024
2 parents cbadd74 + 9c4a5e5 commit 872630f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/utils/concurrency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import os from 'os';

/**
* The maximum number of concurrent tasks we want to have on some CLI and CI tasks.
* The amount of CPUS minus one, arbitrary limited to 15 to not overload CI executors.
* The amount of CPUS minus one, arbitrary limited to 5 to not overload CI executors.
*/
export const maxConcurrentTasks = Math.min(Math.max(1, os.cpus().length - 1), 15);
export const maxConcurrentTasks = Math.min(
Math.max(1, os.cpus().length - 1),
process.env.CI ? 5 : 15
);

0 comments on commit 872630f

Please sign in to comment.