Scaling best practices

204 views
Skip to first unread message

Maksim Surguy

unread,
Sep 22, 2015, 3:14:39 PM9/22/15
to nginxpushstream
One of the main selling points of this module is that it is scalable. My question to the group is, what are best practices and methods you guys and girls use in production for this module? 

The only way i'm thinking this module could be scaled is as follows: 

- Create N number of servers running the module.
- On client (in JS) choose a random number out of N and connect to that server.
- Push new messages to all N servers so that they propagate to all clients connected across servers. 

Is this the preferred way? Is there any other way that would instead connect to a single server (or something that distributes the load) and eliminate frontend random number technique? 

Any tips would be appreciated. Thanks!!!

Milos Stojanovic

unread,
Oct 30, 2015, 5:06:29 AM10/30/15
to nginxpushstream
Thank you Maksim for starting this topic. It is very interesting question and would like to hear some other thoughts on this topic too.

This algorithm you have described above can work well until some JavaScript client has to send something through the network. In this case he has to connect to all servers and push the message, and that's not what we are looking for...

I'm wondering if some kind of load balancer (nginx or HAProxy)  can be used in this case?

Kursad Keskinege

unread,
Mar 8, 2016, 3:16:31 AM3/8/16
to nginxpushstream
Don't know if this topic is still active. But my 5 cents idea is:

1. Client side replication is open to uncontrollable issues

2. Replication / Message passing must be done on server side

I thought and tried following scenario

1. Put N servers in round robin DNS, which will be good for HA
2. When a server gets message, it will propagate it to N-1 servers (tried that with nodejs listener, with channel listener), works great.

Still not sure if this is the right way or not, actually rather than nodejs listener, it will be great to have a directive on nginx, which pushes the message to a logger/listener etc
Reply all
Reply to author
Forward
0 new messages