Skip to content

reneManqueros/load-balancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load Balancer

Simple load balancer written in Go

Features

  • TCP/UDP support
  • Hot swap of backends
  • Low resource footprint
  • Telnet management console

Installation

Download:

git clone https://github.com/reneManqueros/load-balancer

Compile:

cd load-balancer && go build .

Usage

Execute as load balancer:

./loadbalancer balance

Add a backend:

./loadbalancer add 127.0.0.1:8080

Add a backend via telnet - Send a "+" and the address:

telnet 127.0.0.1 33333
+127.0.0.1:8080

Remove a backend:

./loadbalancer add 127.0.0.1:8080

Remove a backend via telnet - Send a "-" and the address:

telnet 127.0.0.1 33333
-127.0.0.1:8080

Parameters

When running as load balancer

Listen for TCP (default)

./loadbalancer balance network=tcp

Listen for UDP

./loadbalancer balance network=tcp

Change listen Port (default: 8081)

./loadbalancer balance address=:8088

Disable management console

./loadbalancer balance management=""

Config file location (default: ./backends.yml)

./loadbalancer balance config="/etc/loadbalancer/backends.yml"

Enable verbose mode (default: false)

./loadbalancer balance verbose=true

Backend timeout in milliseconds (default: 0)

./loadbalancer balance timeout=300

When running as load balancer or when adding/removing backends

Change management console host/port

./loadbalancer balance management="127.0.0.1:12345"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages