wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Push-stream replication #256

Closed M1ha-Shvn closed 4 years ago

M1ha-Shvn commented 7 years ago

Hey.

I want to create multiple push-stream instances in order to increase my service reliability and scalability. What is the best way of doing this?

Now I see only two possibilities:

  1. Backend makes requests to all servers on realtime event. Plus: servers are independent. Minus: double backend work. It's critical as I have a lot of events and there were situations when backend haven't managed the load.
  2. Master NGINX somehow (how? I'll be greatfull for advise) resends events to all slaves which duplicate them to connected clients. Plus: reliable, easy scallable, no backend overwork. Minus: how can I achieve this?

Thanks.

wandenberg commented 7 years ago

@M1hacka There isn't an option to do that only with the module yet. There is an old issue open to implement a cluster. There is a third option that I used years ago. Use some queue system like ActiveMQ or RabitMQ, send the message to it, and each nginx server has a listener that receives the message and forward to nginx instance running the module. You will have a scalable cluster, not so reliable because of the new points of failures but no overhead on your backend.

mikkiek commented 6 years ago

@wandenberg Does exist any plan to implement replication, maybe in nearest or farthest future? Thank you.

wandenberg commented 6 years ago

@mikkiek actually not a plan but an old desire to do it, like discussed in #42