Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question