I am making a chat-application. To scale and use all cores, i am creating 
multiple servers which are listening on same port given by infrastructure 
for listening. Every information is in memory.

However, is it possible that lets say.. A and B are chatting each other and 
have information in process1 and X and Y are chatting and have information 
in process2. 

My question is :

   1. Do programs compete for each message ? If a new message comes from A, 
   Can it go to process2 which have no information about A or B. 

Or does it depend upon something like if i use simple http messages above 
problem would happen but if i use web-sockets it would not happen.

I am using node.js, though i consider it to be a language independent 
problem.

so, code is like :

if (cluster.isMaster) {
  // Fork workers.
  for (var i = 0; i < numCPUs; i++) {
    cluster.fork();
  }} else {
  http.Server(function(req, res) { ... }).listen(8000);}



Should i make only one listening-process which would act like intelligent 
load-balancer that would send the message to right process ?

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/37877663-07de-48cc-a67a-c32499597b2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to