Giter Site home page Giter Site logo

load-balancer's Introduction

Load Balancer

Very simples HTTP/TCP Load Balancer. Implemented in Python3, single thread, using OS selector. The code contains 4 classes that implement different strategies to select the next back-end server:

  1. N to 1: all the requests are routed to a single server
  2. Round Robin: the requests are routed to all servers in sequence
  3. Least Connections: the request are routed to the server with fewer processed connections
  4. Least Response Time: the request are routed to the server with less execution time

At the moment only the fist strategy is fully implemented.

Back-end server

The back-end server was implemented with flask. It provides a simple service that computes the number Pi with a certain precision.

Prerequisites

$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -r requirements.txt

How to run

$ source venv/bin/activate
$ ./setup.sh

How to access the load balancer

Go to a browser and open this link. The number after the URL specifies the precision of the computation.

How to Stress Test

$ ./stress_test.sh

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

load-balancer's People

Contributors

tiagocmendes avatar

Stargazers

Gabriel Igor 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.