diff --git a/doc/api/cluster.markdown b/doc/api/cluster.markdown index 1332bd4eed..059037bc74 100644 --- a/doc/api/cluster.markdown +++ b/doc/api/cluster.markdown @@ -233,7 +233,7 @@ Example: args : ["--use", "https"], silent : true }); - cluster.autoFork(); + cluster.fork(); ## cluster.fork([env]) @@ -436,7 +436,11 @@ in the master process using the message system: } // Start workers and listen for messages containing notifyRequest - cluster.autoFork(); + var numCPUs = require('os').cpus().length; + for (var i = 0; i < numCPUs; i++) { + cluster.fork(); + } + Object.keys(cluster.workers).forEach(function(id) { cluster.workers[id].on('message', messageHandler); });