This is my own implementation of an Round-Robin API Load Balancer in Go using concurrent programming and synchronization techniques. Coding Challenges series by John Crickett https://codingchallenges.fyi/challenges/challenge-load-balancer/
- Active and Passive Healthchecks
- Healthcheck url on servers with checks dependent resources (Redis, DB, etc)
- Round-Robin requests to all active servers
TODO:
- Different algorithms: Round-Robin, Least-Connections (TODO)
- Retry & Timeout mechanism (TODO)
- Self register new servers to the LB pool
make build
make install
Start two or more servers using different ports
golb --type node --addr :8081
golb --type node --addr :8082
Start the Load Balancer and the urls of the existing servers
golb --type lb --addr :8080 --urls http://localhost:8081,http://localhost:8082
curl --parallel --parallel-immediate --parallel-max 4 --config urls.txt