23
votes
1answer
9k views

How do I use Node.js clusters with my simple Express app?

— I built a simple app that pulls in data (50 items) from a Redis DB and throws it up at localhost. I did an ApacheBench (c = 100, n = 50000) and I'm getting a semi-decent 150 requests/sec on a ...
1
vote
1answer
2k views

Node.js multi-server cluster: how to share object in several nodes cluster

I want to create a cluster of node.js server in order to support many concurrency simultaneously, for a chat rooms applications. The servers hold information that needs to be shared between all nodes, ...
9
votes
3answers
8k views

NodeJS|Cluster: How to send data from master to to all or single child/workers?

I have working (stock) script from node var cluster = require('cluster'); var http = require('http'); var numReqs = 0; if (cluster.isMaster) { // Fork workers. for (var i = 0; i < 2; i++) { ...
7
votes
2answers
2k views

Debugging Node.js processes with cluster.fork()

I've got some code that looks very much like the sample in the Cluster documentation at http://nodejs.org/docs/v0.6.0/api/cluster.html, to wit: var cluster = require('cluster'); var server = ...
2
votes
1answer
2k views

Socket.io websocket authorization failing when clustering node application

Question: Is it possible to cluster an application which is using Socket.io for WebSocket support? If so what would be the best method of implementation? I've built an application which uses Express ...
5
votes
1answer
4k views

Using socket.io with Cluster?

I'm curious that I can use both socket.io and Cluster. I know that cluster uses multi-core to work on node.js with multiple workers. That means if I use cluster for socket.io, two users with ...
2
votes
3answers
2k views

npm cluster error on node.js 0.6.5

I uses the following code to take advantage of cluster npm for my node app. form = require("connect-form"); express = require("express"); app = express.createServer(form({ keepExtensions: true })); ...
4
votes
1answer
598 views

Node.js Clustering - What determines load balancing?

I have read over this article pretty thoroughly and as well have spent a few hours researching the subject of clustering (forking processes) in Node.js. What I can't seem to understand from the ...
3
votes
1answer
141 views

What are the basics of securely interconnecting node.js applications/workers/clusters?

I'm looking for advise on the 'right way' to authenticate interconnecting node.js applications. The use case is general: to share work tasks, sync data or for a control/monitoring channel. Databases ...
2
votes
2answers
2k views

Running Node.js App with cluster module is meaningless in Heroku?

Heroku can run Web Dynos and Worker Dynos so that Web Dynos take care of routes and worker Worker Dynos take care of processing works. Since there is a unit of Dyno, It seems using Node.js ...
1
vote
1answer
300 views

nodejs cluster module - Address in use error

I have an express.js application and it has to run a sub-process everytime there is a particular request (here it is : /compute/real-time ). There will be user-created scripts to compute the data. So, ...