andrenbrandao / load-balancer

Load Balancer - John Crickett's Coding Challenge #5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:Go 98.7%Language:Makefile 1.3%