S
S
Sergo Sergo2015-09-17 13:33:47
Node.js
Sergo Sergo, 2015-09-17 13:33:47

How to synchronize the amount of online?

I am building a node.js server using cluster. I need to synchronize the amount of online between child processes. What is the best way to do this? I tried to take data from the parent process through process.send, but I think that this is not the best option. Can you suggest something?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Shemsedinov, 2015-09-17
@sergo_serga

Write to the database, for example, to Mongo via inc. Synchronizing through process.send is also not bad, but it is better to make TCP sockets between processes, I compared them, they work faster. Although, if we are only talking about the number of connections, then it does not matter what to synchronize, this is not a lot of data and not a very intensive exchange.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question