- Notifications
You must be signed in to change notification settings - Fork611
-
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 |
BetaWas this translation helpful?Give feedback.
All reactions
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.
Replies: 6 comments 3 replies
-
i use nats for that, works well |
BetaWas this translation helpful?Give feedback.
All reactions
-
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. |
BetaWas this translation helpful?Give feedback.
All reactions
-
@emdotem It is works only in Linux, just add |
BetaWas this translation helpful?Give feedback.
All reactions
-
NODE_CLUSTER_SCHED_POLICY does not affect uws |
BetaWas this translation helpful?Give feedback.
All reactions
-
Sorry to comment this closed issue, I hope you will see it but when you talk about cluster you mean the nodejs cluster modulehttps://nodejs.org/docs/latest/api/cluster.html ? |
BetaWas this translation helpful?Give feedback.
All reactions
-
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 |
BetaWas this translation helpful?Give feedback.
All reactions
-
hello if we use a proxy then event loop of the proxy will wait i think so latency wont improve.. please tell me if m wrong |
BetaWas this translation helpful?Give feedback.
All reactions
-
@kuabhish By using a message broker like redis, rabbitmq, or if you're running multiple uws process in the same host using node cluster then you can do IPC. |
BetaWas this translation helpful?Give feedback.
All reactions
-
How do i communicate with different process using IPC. the way i do it is using ws with Map() and thats when you have one instance running. With works, i belive you have one instance but the others ie load are running with all the cores but they share same truth so
might work, but how to go about this is unknown |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #214 on December 09, 2020 05:50.