diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index ec0e80a9e7edbe..e8c5ee7711ab33 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -65,7 +65,7 @@ class WrkBenchmarker { const args = [ '-d', duration, '-c', options.connections, - '-t', Math.min(options.connections, require('os').cpus().length || 8), + '-t', Math.min(options.connections, require('os').availableParallelism() || 8), `${scheme}://127.0.0.1:${options.port}${options.path}`, ]; for (const field in options.headers) { diff --git a/tools/build-addons.mjs b/tools/build-addons.mjs index b0ec02d8e90cba..a96c18435ddc03 100755 --- a/tools/build-addons.mjs +++ b/tools/build-addons.mjs @@ -11,7 +11,7 @@ import os from 'node:os'; const execFile = util.promisify(child_process.execFile); -const parallelization = +process.env.JOBS || os.cpus().length; +const parallelization = +process.env.JOBS || os.availableParallelism(); const nodeGyp = process.argv[2]; const directory = process.argv[3];