Skip to content

Instantly share code, notes, and snippets.

@mikezhuyuan
Created February 14, 2012 14:50
Show Gist options
  • Save mikezhuyuan/1827268 to your computer and use it in GitHub Desktop.
Save mikezhuyuan/1827268 to your computer and use it in GitHub Desktop.
var cluster = require('cluster');
if (cluster.isMaster) {
for(var i=0; i<10; i++)
cluster.fork();
} else {
setInterval(function(){
console.log(process.pid);
}, 1000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment