Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

bench: start (NUM_CPUS-1) workers

The master is a worker too so fork off one less worker.
  • Loading branch information...
bnoordhuis committed Nov 9, 2011
1 parent cdcb111 commit 4fc0fdc6ee8c41320f4d4ea74e4fa8a3ac12ed57
Showing with 2 additions and 1 deletion.
  1. +2 −1 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');
}

0 comments on commit 4fc0fdc

Please sign in to comment.
You can’t perform that action at this time.