Skip to content

Implement layer 4 load balancer using Ha Proxy to serve two nodejs app servers.

Notifications You must be signed in to change notification settings

ahmedmeshref/load-balancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

load-balancer

Implement layer 4 load balancer using Ha Proxy to serve two nodejs app servers.

Getting Started

Requirements

Install the following requirements for before proceeding to the app installation

Getting Started

Configure Ha Proxy

  • Copy haproxy configuration file and paste it in your haproxy configuration file ('/etc/haproxy/' on linux).
  • Reload haproxy service. On linux, use sudo service haproxy reload.

Clone Repository

Navigate to your project folder on local machine and execute the following command from your terminal to clone the repository into your current directory locally.

git clone https://github.com/ahmedmeshref/load-balancer.git

Install Dependencies

From your terminal, install all dependencies needed by executing npm install.

Run App

From your terminal, run the application with npm start. Two Application instances are going to be created. App can be accessed on http://localhost:8888.

(Optional) Test load balancer

Note: You should have python installed alongside with the requests library to perform this task.

Run the python script req.py, which sends 1000 requests to the application. Ha Proxy will use the two app servers interchangeably.

About

Implement layer 4 load balancer using Ha Proxy to serve two nodejs app servers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages