Skip to content

Instantly share code, notes, and snippets.

@seriousManual
Created June 11, 2012 10:01
Show Gist options
  • Save seriousManual/2909389 to your computer and use it in GitHub Desktop.
Save seriousManual/2909389 to your computer and use it in GitHub Desktop.
replicating process.send not working anymore. after a while messages sent from worker do not reach the master instance when under heavy load (~7000req/s).
var cluster = require( 'cluster' )
,http = require( 'http' );
if ( cluster.isMaster ) {
for (var i = 0; i < 8; i++) {
var worker = cluster.fork();
worker.on( 'message', function() {
console.log( Math.random() );
} );
}
} else {
http.createServer(function (req, res) {
process.nextTick( function() {
process.send( {} );
console.log( process.pid + ': sending' );
res.end( 'hello :) ' );
} );
} ).listen( 1337 );
}
@srlowe
Copy link

srlowe commented Sep 29, 2014

Hi - did you ever figure this out?

@seriousManual
Copy link
Author

actually no, but they seem to have fixed it: nodejs/node-v0.x-archive#3413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment