https://github.com/thisisnotjustin/balencigo
Lightweight and scalable loadbalancer written in Go with a focus on concurrency
https://github.com/thisisnotjustin/balencigo
go software-engineering
Last synced: 8 days ago
JSON representation
Lightweight and scalable loadbalancer written in Go with a focus on concurrency
- Host: GitHub
- URL: https://github.com/thisisnotjustin/balencigo
- Owner: ThisIsNotJustin
- Created: 2024-12-23T07:47:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-08T23:20:23.000Z (4 months ago)
- Last Synced: 2025-05-09T01:46:57.553Z (8 days ago)
- Topics: go, software-engineering
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BalenciGo
BalenciGo is a lightweight, scalable load balancer written in Go.
## Features
- Round-Robin Load Balancing: Distributes incoming requests evenly across available servers.
- Health Checks: Coninuously monitors server health to avoid routing to inactive or failing servers.
- Concurrency: Built keeping synchronization for thread-safe operations in mind by utilizing a mutex.## Getting Started
### Prerequisites
- Go
- Internet Connection (for testing functionality)## Installation
Clone the repository:
```bash
git clone https://github.com/ThisIsNotJustin/balencigo.git
```
Run the project:
```bash
go run main.go
```## Example Usage
By default BalenciGo routes requests to the following demo servers
- GitHub
- DuckDuckGo
- Kagi## Testing
To test the load balancer, visit http://localhost:8080 in the browser.
Requests will then be forwarded to the configured servers in a round-robin cycle.## Configuration
Edit the addresses array in main.go to specify the server URLs:
```go
addresses := []string {
"https://github.com",
"https://duckduckgo.com",
"https://kagi.com",
}
```Edit the time interval of the health checks by editing the following
```go
server.StartHealthCheck(10*time.Second, ctx)
```