An open API service indexing awesome lists of open source software.

https://github.com/mongoexpuser/nodejs-load-balancer-on-ec2

Load Balancing of Web or Application Servers with NodeJS
https://github.com/mongoexpuser/nodejs-load-balancer-on-ec2

aws cloud-provider ec2 load-balancer logger-middleware nodejs

Last synced: 10 months ago
JSON representation

Load Balancing of Web or Application Servers with NodeJS

Awesome Lists containing this project

README

          

## Nodejs-Load-Balancer-On-EC2

Load Balancing of Web or Application Servers with a NodeJS load balancer (lb) application.

## Architectural Diagram
![Image description](https://github.com/MongoExpUser/Nodejs-Load-Balancer-on-EC2/blob/main/nodejs-lb-arch-digram.png)


## Purpose
* Load Balancing of Web or Application Servers on AWS EC2 machine.
* The current demonstration is for an AWS EC2 instance but the NodeJS application can be run on any cloud provider VM e.g (Linode, GCP, Azure, OCI, DO, etc.) as long as the network is properly set up.

## Advantages
* Fast.
* Cheaper.
* Easy to deploy.
* Load requests across multiple machines globally.

## Install Dependency
* NodeJS 19+ or above (https://nodejs.org/en/download)

## Run App
* To run the load balancing app:

- Download the following source files in this repository:

- appLB.js

- common.js

- config.json

- Edit relevant input variables within the config.json file, as deem necessary.

- Upload the source files to the same folder on an AWS EC2 machine.

- Then, run the appLB.js script from within the folder as:
sudo node --inspect=$((9233 + $RANDOM % 100)) --trace-warnings --trace-deprecation --watch appLB.js

# License
Copyright © 2023. MongoExpUser