Skip to content

Ghurtchu/lb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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