Skip to content

Instantly share code, notes, and snippets.



Last active Jan 27, 2016
What would you like to do?
Sample of NodeJS as a cluster
* Cluster NodeJS
var cluster = require('cluster');
if (cluster.isMaster) {
var cpuCount = require('os').cpus().length;
for (var i = 0; i < cpuCount; i += 1) {
} else {
var http = require('http');
http.createServer(function (req, res) {
res.end('Hello world!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.