Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marialuizaleitao/go-load-balancer
Simple Load Balancer implemented in Golang.
https://github.com/marialuizaleitao/go-load-balancer
golang load-balancer
Last synced: about 2 months ago
JSON representation
Simple Load Balancer implemented in Golang.
- Host: GitHub
- URL: https://github.com/marialuizaleitao/go-load-balancer
- Owner: marialuizaleitao
- Created: 2024-06-27T18:32:40.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-06-27T19:04:42.000Z (6 months ago)
- Last Synced: 2024-07-14T09:08:17.740Z (6 months ago)
- Topics: golang, load-balancer
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Go Load Balancer
This project implements a simple and thread-safe load balancer in Go, capable of distributing incoming HTTP requests among multiple backend servers using a round-robin algorithm. Each backend server is represented as an interface, allowing flexibility in defining server behavior and health checks.
## Features
- **Round-Robin Load Balancing**: Requests are evenly distributed across available servers.
- **Thread-Safe Implementation**: Uses `sync.Mutex` to ensure safe access to shared resources.
- **Dynamic Server Addition**: Easily extendable to add or remove backend servers.## How It Works
The load balancer listens on a specified port and forwards incoming requests to backend servers based on a round-robin selection mechanism. It ensures that only healthy servers receive requests by checking their health status through the `Server` interface.
## Usage
### Requirements
- Go 1.16 or later installed on your machine.
### API Endpoints
- **Root Endpoint `/`**: All incoming requests are load balanced among the configured backend servers.