A high-performance, intelligent Layer 7 load balancer written in Go. This project aims to distribute network traffic across backend servers efficiently using adaptive algorithms, ensuring high availability and fault tolerance. It comes equipped with a real-time monitoring dashboard to visualize cluster health.
- Adaptive Routing: Intelligently routes traffic based on server load, response time, and active connections.
- Active Health Checks: Automatically detects unhealthy backends and removes them from the pool until they recover.
- Concurrency: Built on Go's goroutines to handle thousands of concurrent requests with minimal footprint.
- Visual Dashboard: A web-based interface (located in
dashboard/) to monitor traffic flow and server status in real-time. - Configurable: Easy-to-adjust settings for ports, timeouts, and backend pools.
.
├── cmd/
│ └── balancer/ # Application entry point (main.go)
├── dashboard/ # Frontend dashboard code
├── internal/ # Core logic (Balancing algorithms, Health checks)
├── go.mod # Go module definitions
└── go.sum # Dependency checksums
- Go 1.20+
- Git
- Clone the repository
git clone [https://github.com/Suke2004/load-balancer.git](https://github.com/Suke2004/load-balancer.git)
cd load-balancer
- Install dependencies
go mod download
- Run the Load Balancer
go run cmd/balancer/main.go
The server should start on the default port (e.g., 8080). You can verify it is running by sending a request to localhost or opening the dashboard URL provided in the terminal logs.
Configuration can usually be modified via flags or a config file (depending on implementation details). Common settings to look for in main.go:
- Port: Listening port for the balancer.
- Backends: List of target servers.
- Strategy: Round Robin, Least Connections, or Weighted.
To run the unit tests for the internal packages:
go test -v ./internal/...
We welcome contributions! Please read our CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Suke2004