Skip to content

Instantly share code, notes, and snippets.

@IvanGuardado
Last active August 29, 2015 14:02
Show Gist options
  • Save IvanGuardado/5290e145e74fcc41a733 to your computer and use it in GitHub Desktop.
Save IvanGuardado/5290e145e74fcc41a733 to your computer and use it in GitHub Desktop.
Node.js, The Bad Parts
var cluster = require('cluster');
var cpus = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < cpus; i++) {
cluster.fork();
}
}
// ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment