Load balancing in NodeJs and Express
- Round Robin
- Least Connections
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need to install node in your system. Download it from here.
A step by step series of examples that tell you how to get the web application running
Clone the repo and enter inside the directory
$ git clone https://github.com/leonatwork/load-balancing.git
$ cd load-balancing
Install all npm modules
$ npm install
To run the round robin version
$ node server-rr.js
- The app should be up and running at localhost:8080
- The Round Robin server listens at port 8080, and three other servers run at ports 3000,3001 and 3002
To run least connection version
$ node server-lc.js
- The app should be up and running at localhost:8081
- The Least Connection server listens at port 8081, and three other servers run at ports 4000,4001 and 4002
- HTML
- Javascript
- CSS/bootstrap
- NodeJs
- Express