Comments (2)
Sorry for late response got a lot of work lately.
Unfortunately u have misunderstood how it works, slave servers are like separate servers completely, you have to use load balancer like nginx
to make auto selection between servers. Basically the reason for this horizontal scaling was to be able to run servers in different location and communicate between them through channels.
For example if u live in New Zealand u can set up one server in Auckland another one in Wellington and connect them together. People from wellington can connect to wellington server and be able to communicator to people form Auckland (who are connected to Auckland server) through the channels so everyone will get good service (of cause u need to have very good internet connection between your servers).
That was basic example how u can use them.
What u can also do is to create a lot of droplets on Digital Ocean connect all the slave servers from each droplet between each other through master server, set up nginx
on one single server which will decide to which droplet server send new connection. And this will allow to handle lot of connection and all of servers will be able to communicate between each other through channels.
In your case as u explains f u will connect only to the server which u request so if u got to Master on: 80, PID: 16409
u will be connected to the master server and if u go to Master on: 8003, PID: 9486
u will connect to slave server. There is no reason to create slaves and masters
or use Horizontal scaling on single machines as u can just use cluster (workers) which do it much better and allow to use all cores and memory plus share the same port. Horizontal scaling is useful only if u have more then one machine so u can run master server on one machine and slave server on anotherone.
Master saver is naming for the server which responsible for re sending messages which it gets from the slaves to all other connected slave servers (and itself of cause too).
from clusterws.
Ok, thanks :)
from clusterws.
Related Issues (20)
- Is it possible create different (non clone) processes? HOT 4
- Close/Stop/Kill the server HOT 1
- How to determine which process current code is running in. HOT 7
- Having interest in translate document to zh-CN HOT 7
- Plz add `upgradeReq` argument, let it back HOT 1
- Can I store a dictionary in memory accessed from each workers? HOT 4
- How to upload files? HOT 4
- Publish to channel but only to some users HOT 5
- Callback in verify connection middleware HOT 6
- ws / wss proxy with nginx HOT 7
- How to send msg by userid connection? HOT 1
- Del
- Websockets inside a cluster, ok in production? HOT 2
- Callback issue on verifyConnection middleware HOT 12
- benchmark & does it work on browser too ? HOT 2
- uws not compiled for node 7.2
- How to see the list of channels a client is subscribed to HOT 3
- Don't understand what .processMessage is for? HOT 5
- Middleware.onPublishIn ? HOT 1
- TypeError: this.options.logger.warning is not a function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clusterws.