Giter Site home page Giter Site logo

pde's Introduction

PDE

(Or, Prescriptive Data Exercise)

Using NGINX, Registrator, Consul and Consul-Template to Load Balance between Nginx Web Servers.

How to Run

docker-compose build                   #make sure there are no image conflicts
docker-compose up --scale nginx-web=5  #scale the web servers up and down with this command

Consul API is available on localhost:8500 and the web server is available on localhost - might want to change to a non-privileged port.

How it works

Registrator connects to the docker UNIX socket to get information on containers sent to Consul. Consul-template is used in both the LB Nginx Container to provide the LB nginx-web container endpoints, and in the Web Server Nginx containers to provide a list of all Containers.

Improvements

  • Bootstrap Consul Server with 3 instances instead of one for HA, and add Clients across a larger pool of Container Instances/Kubernetes
  • Add Service Health Checks (would necessitate another Dockerfile)
  • Introduce a rsyslog, statsd, or similiar loging service for log consolidation in one endpoint
  • Consul Connect would add a layer of authentication. TLS between the Nginx LB and Web Servers would prevent anonymous proxies
  • Nginx Web Servers block would benefit from not being an <embed>

Load Handling

Scaling up the web servers to 55 containers used ~4 GB and 20% of my laptop's CPU. Could probably comfortably scale up the web servers up to 200 containers, and many more with a cluster of container instances. No limits found with performance of Consul/Registrator.

Sources

pde's People

Contributors

sixxta avatar

Watchers

James Cloos 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.