Skip to content

andrenbrandao/load-balancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load Balancer - Coding Challenge #5

Load balancer implementation with Go. It is a solution to John Crickett's Coding Challenges.

Terminal Animation

There are 2 main files:

  • lb is the load balancer and it implements a Round Robin algorithm, sending requests to three different servers at ports 8081, 8082 and 8083.
  • be is a simple backend server written in Go to answer the GET requests.

How to build

Execute make build to create the executables. It will be saved in the bin/ directory.

How to run

Execute three different web servers.

./bin/be -p 8081
./bin/be -p 8082
./bin/be -p 8083

Now, execute the load balancer.

./bin/lb

You can use cURL to make a request to our load balancer.

curl http://localhost:8080

And to simulate multiple requests, you can use wrk.

wrk http://localhost:8080 -t2 -c10 -d2

License

MIT © André Brandão

About

Load Balancer - John Crickett's Coding Challenge #5

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published