golang-load-balancer

command module
v0.0.0-...-cd364a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 15 Imported by: 0

README

Golang Load Balancer

Project of a Load Balancer in Golang

A load balancer is a device responsible for distributing network traffic among a certain number of servers. Its a fundamental piece to increase reliability and robustness of modern applications

The concept behind this project consists of a basic load balancer written in Golang.

The input is given through a configuration file refered to as config.yaml, example of a configuration file down below:

## Load Balancer Port
lb_port: 3333
## Retry limit of a backend server 
retry_limit: 3
## Backend servers host
backends:
  - "http://localhost:100"
  - "http://localhost:101"

This load balancer supports two strategies:

  • Round Robin: this algorithm equally distributes incoming traffic among the available servers
  • Least Connections: traffic is distributed taking into account the number of active connections in each server

The strategy con be specified in the configuration file:

lb_port: 3333
## LB strategy (uses round-robin as default)
strategy: least-connection
retry_limit: 3
backends:
  - "http://localhost:100"
  - "http://localhost:101"

References

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL