Giter Site home page Giter Site logo

load-balancer's Introduction

Load Balancer

A simple load balancer with cli implemented in Node.js and Express.

Demo: https://youtu.be/yqBR1M1jlPA?si=EcGiI7i7gxPPoxkp

Description

This project is a basic implementation of a load balancer using NodeJS and ExpressJS. The load balancer distributes incoming requests across multiple servers to ensure efficient utilization of resources and improved system reliability.

Screenshot 2023-12-23 214943

Features

  • Distributes incoming requests across multiple servers.
  • Health checks to monitor server status.
  • Simple CLI configuration for setting up server details.
  • Logging of requests and errors for monitoring.

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/load-balancer.git
    
    
  2. Install dependencies:

    cd load-balancer
    npm install
    
    

Usage

  1. Configure the load balancer using the CLI:

    start-lb
    

The CLI tool prompts the user for essential details, including:

  • Number of servers
  • Server URLs
  • Health check endpoint
  • Health check period
  • This configuration ensures the load balancer has accurate information about available servers and their health.
  1. Send requests to the load balancer and observe the distributed load among servers.

Technical Details

Round-Robin Load Balancing

The load balancer utilizes a round-robin algorithm to evenly distribute incoming requests among the available servers. This ensures each server gets an equal share of the load, preventing any single server from becoming a bottleneck.

Health Checks

Periodic health checks are performed on each server to verify its availability. If a server fails a health check, it is temporarily removed from the rotation, preventing the load balancer from directing requests to an unhealthy server.

Logging

The load balancer logs every incoming request and any encountered errors. This logging mechanism aids in monitoring and troubleshooting the system.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

This project is licensed under the MIT. License. Feel free to customize this further based on your specific implementation details and preferences.

load-balancer's People

Contributors

harshilsharmaa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.