The Simple Go Load Balancer is a basic load balancing application written in Go. It uses a round-robin algorithm to distribute incoming requests across multiple backend servers.
- Round-robin load balancing
- Customizable backend servers
- Basic health checks
- Go installed on your machine
-
Clone the repository:
git clone https://github.com/newlinedeveloper/loadbalancer.git
-
Change into the project directory:
cd loadbalancer -
Build the project:
go build
-
Start the load balancer:
./loadbalancer
-
The load balancer will be running on
localhost:8000.
You can customize the load balancer by modifying the main.go file. You can add or remove backend servers and adjust weights as needed.
// Example of adding a new backend server
servers := []Server{
newSimpleServer("https://www.example.com"),
// Add more servers as needed
}Contributions are welcome! If you find any issues or have improvements, feel free to open a GitHub issue or submit a pull request.