Browse Source

bench: start (NUM_CPUS-1) workers

The master is a worker too so fork off one less worker.
v0.7.4-release
Ben Noordhuis 13 years ago
parent
commit
4fc0fdc6ee
  1. 3
      benchmark/http_simple_cluster.js

3
benchmark/http_simple_cluster.js

@ -2,7 +2,8 @@ var cluster = require('cluster');
var os = require('os');
if (cluster.isMaster) {
for (var i = 0, n = os.cpus().length; i < n; ++i) cluster.fork();
console.log('master running on pid %d', process.pid);
for (var i = 1, n = os.cpus().length; i < n; ++i) cluster.fork();
} else {
require(__dirname + '/http_simple.js');
}

Loading…
Cancel
Save