Weighted Round Robin Load Balancer Example
how to setup
- install dependecies
npm install
- install nginx if it has not been installed
brew install nginx
- modify nginx.conf file
- backup file before making changes
- location of nginx.conf file for mac is at
/usr/local/etc/nginx
- run nginx
brew services start nginx
- run server 1
PORT=3000 node server.js
- run server 2
PORT=3001 node server.js
- send request
curl localhost:8081/hello
a few times to see how the load balancer works