-
Is it possible to have multiple instances of the server and make sure the communication among sockets connected to different instance works? I'm thinking about having a message broker in the middle for communication |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
i use nats for that, works well |
Beta Was this translation helpful? Give feedback.
-
You can scale with multiple instances, yes. Either listen to the same port (Linux only) or listen to a set of ports which are then proxied or whatever. You can also scale using DNS, etc. |
Beta Was this translation helpful? Give feedback.
-
@emdotem It is works only in Linux, just add |
Beta Was this translation helpful? Give feedback.
-
NODE_CLUSTER_SCHED_POLICY does not affect uws |
Beta Was this translation helpful? Give feedback.
-
Sorry to comment this closed issue, I hope you will see it but when you talk about cluster you mean the nodejs cluster module https://nodejs.org/docs/latest/api/cluster.html ? |
Beta Was this translation helpful? Give feedback.
-
It doesn't matter. I'm pretty sure Workers works also. Or just start separate processes altogether. None of it matters, it is the Linux kernel which does the load balancing. Or use a proxy it doesn't matter |
Beta Was this translation helpful? Give feedback.
You can scale with multiple instances, yes. Either listen to the same port (Linux only) or listen to a set of ports which are then proxied or whatever. You can also scale using DNS, etc.