Skip to content

pariola/lb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lb

a reverse proxy load-balancing server, It implements the Weighted Round Robin Balancing algorithm referenced here.

Installing | How to Use | Configuration

Installing

Using go install

You can use the command below to compile and install directly to your $GOPATH/bin

go install github.com/pariola/lb@latest

How to Use

After installing, run the command below to start the server:

lb <PATH TO CONFIG FILE>

Now the server proxies every request to downstream backends.

Configuration

Configuration format is YAML and path defaults to lb.yml.

Available Values

Name Description Default
port Port the server will listen on 3000
retries Amount retries per request 1
health.path URL path to listen to for liveness checks /
health.interval Interval to perform the liveness checks 30s
backends.[].host Downstream Server URL to proxy requests to (ex. localhost:4023) -
backends.[].weight Weight to influence the amount of requests received by the downstream backend 1

Example Configuration:

port: 5000
retires: 5
health:
  path: /health
  interval: 30s
backends:
  - host: "localhost:5000"
    weight: 2
  - host: "localhost:5001"
    weight: 1

About

Simple Reverse Proxy Load Balancer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages