Giter Club home page Giter Club logo

haproxy's Introduction

Load balancing with lxc containers

This configuration of software demonstrates the Round Robin principle of a load balancer, with 2 webservers provided by Nginx and Haproxy as the Load Balancer using Ansible for simplicity of setup (as the alternatives are quite involved).

Dependencies LXD & Ansible

A terminal is required to perform the following steps:

1. Clone the repo
git clone https://github.com/micrometreuk/haproxy.git

2. Change to the directory
cd haproxy

3. Creating the containers and provisioning required software within them.
make containers

Installation Validation Test

You should see somthing displayed similar to the below:
alt text

  1. Ansible creates the required LXC containers and installs desired software.
  2. Your default browser opens the HAProxy server and refreshes every 3 seconds to display the alternating output of the 2 web servers.
  3. HAProxy can also provides a statistics report. This is opened and displayed in another browser window.

Other Performance Tests

Terminal Output
To run this test 10 times and display the alternating server results within the terminal, type the following and replace the below IP with the IP address of YOUR Load Balancer.
for run in {1..10}; do curl -I http://(LoadBalancersIP)/; done
Client fot URL's (cURL) will display the header info only per request within the terminal window.

Apache benchmark
For more information on average response times, failed requests, transfer rate, and more, install Apache utils with: sudo apt-get install apache2-utils

To run a test with ApacheBenchmark with 10000 requests with a concurrency of 1000.
ab -n 10000 -c 1000 http://(LoadBalancersIP)/

Destroy the demo enviroment

Once you are finished with this demonstration, run the below command to remove the created containers.
make unmake

haproxy's People

Contributors

darway avatar micrometre avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.