GithubHelp home page GithubHelp logo

load_balancer's Introduction

Load Balancer Project

Introduction

This Load Balancer project is a simple yet functional implementation of a load balancing system. It distributes incoming HTTP requests across multiple backend servers using a round-robin scheduling algorithm and maintains high availability by performing regular health checks on the servers. The project is intended for educational purposes and provides a foundational understanding of how load balancers work in a networked environment.

Requirements

  • Python 3.x
  • Basic understanding of networking and HTTP protocol
  • Backend servers running on different ports for load balancing (e.g., Python's built-in HTTP server)

Installation

No additional installation is required, as the script uses Python's built-in libraries. Ensure that Python 3.x is installed on your system.

Running the Load Balancer

Start Backend Servers:

Ensure that you have at least two backend servers running on different ports.

Example command to start a simple HTTP server in Python:

python -m http.server 8080 --directory server8080

Repeat the command for different ports and directories as needed.

Run the Load Balancer:

  1. Clone or download the load balancer script from the repository.
  2. Run the script using Python:
    python load_balancer.py
    The load balancer will start on port 80 by default.

Usage

After starting the load balancer, send HTTP requests to http://localhost/. The load balancer will forward the requests to the backend servers in a round-robin fashion. The health check mechanism will periodically check the availability of the backend servers. Unhealthy servers will be temporarily removed from the round-robin pool until they pass the health check again.


The health check mechanism will periodically check the availability of the backend servers. Unhealthy servers will be temporarily removed from the round-robin pool until they pass the health check again.

load_balancer's People

Contributors

xj85770 avatar

Watchers

 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.