Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rimo02/gobalancer
Simplest Load Balancer to route traffic
https://github.com/rimo02/gobalancer
golang load-balancer reverse-proxy
Last synced: 3 days ago
JSON representation
Simplest Load Balancer to route traffic
- Host: GitHub
- URL: https://github.com/rimo02/gobalancer
- Owner: rimo02
- Created: 2024-05-02T06:32:27.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-08T13:25:57.000Z (6 months ago)
- Last Synced: 2024-06-07T20:27:15.145Z (5 months ago)
- Topics: golang, load-balancer, reverse-proxy
- Language: Go
- Homepage:
- Size: 4.49 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang Load Balancer
This project implements a load balancer which is a necessicity in todays internet era. Modern webistes might have to deal with hundreds of thousands of requests and thus it's important to route traffic to the suitable server so that the underlying infrastructure can handle the traffic and keep on its buisness ongoing.
## Overview
A load balancer is a tool that is commonly used to coordinate the volume of traffic between the available servers.
A load balancer sits in front of a group of servers which is referred to as Serverpool, and the load distribution is performed based on various load balancing algorithms.## Features
* Weighted Round-Robin Scheduling Algorithm: The load balancer uses the Weighted Round-Robin (WRR) algorithm to distribute traffic. This algorithm assigns weights to each server, allowing the load balancer to prioritize servers based on their capacity or performance. It ensures that healthier backends with available capacity receive more requests.
* Health Checks: The load balancer continuously monitors the health of the backend servers, ensuring that traffic is only directed to servers that are capable of handling requests.The input is given through the configuration file `config.yaml`. You can change it as per your requirements
``` yaml
//port in which load balancer will be running
lb_port: 3000
//available backend servers
backends:
- url: "http://localhost:5100"
weight: 5
- url: "http://localhost:5200"
weight: 3
- url: "http://localhost:5300"
weight: 4
- url: "http://localhost:5400"
weight: 1
- url: "http://localhost:5500"
weight: 2```
## Future Works
* Implement the various other scheduling algorithms
* Add some security measures## References
* ([load_balancer](https://github.com/leonardo5621/golang-load-balancer/tree/master))
* ([simplelb](https://github.com/kasvith/simplelb))