This is a load Balancer built with go that can balance the requests across Backends.
- Clone the repository:
git clone https://github.com/Harichandra-Prasath/Go-Balancer.git
cd Go-Balancer
-
Create config.json Configuration
-
Run the application
make run
Below is the template for config.json
{
"Port":,
"Backends":["","",...],
"ALGO":"",
"STATIC_ROOT":"",
"MEDIA_ROOT":"",
"Poll_Period":
}
- Port : INT
Port for the Go-Balancer - Backends : [ ]String
List of Url strings of the backends - ALGO : String
Algorithm used to balance the requests - STATIC_ROOT : String
Path string of the directory used to server Static Content - MEDIA_ROOT : String
Path string of the directory used to server Media Content - Poll_Period : UINT
Time in seconds that should be used for Passive Health checking of the backends
It is must for the config.json to have all the fields, exlusion of any field will result in failure
Currently Supported Algorithms
"RR" : Round Robin
"LC" : Least Connections
"RANDOM" : Randomly choosen backend
Path MUST be Absolute from the root of the System
- Including additional Balancing Algorithms like Spill Over , etc..