Ghurtchu / lb

application layer load balancer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo video tutorial for testing: https://www.youtube.com/watch?v=SkQ6s_nwCgY

Current implementation uses round robin algorithm for distributing requests.

Also, it periodically checks the availabilty of backends and stops forwarding requests to the unavailable servers.

As soon as dead server is back and up & running it starts forwarding requests to it.

Comprehensive testing instructions:

Configure load balancer in src/main/resources/application.conf: My Image

Run a few backends on different ports:

  • ./be 8081 My Image
  • ./be 8082 My Image
  • ./be 8083 My Image

Run the load balancer and observe health check logs:

  • ./lb My Image

Ping the load balancer and observe responses from different servers:

  • curl localhost:8080 My Image

Stop one of the backends (8081): My Image

Observe the load balancer adjust distributing requests to only two servers: My Image

Run the server with port 8081 again:

  • ./be 8081 My Image

Observe the load balancer adjust distributing requests to all three servers again:

  • curl localhost:8080 My Image

About

application layer load balancer


Languages

Language:Scala 98.5%Language:Python 1.3%Language:Shell 0.2%