D-Andreev / tiny-loadbalancer

Tiny load balancer
MIT License
0 stars 0 forks source link

tiny-loadbalancer

build test

TinyLoadbalancer is an HTTP load balancer that supports several strategies for distributing incoming requests across a pool of backend servers. It uses a configuration file to define its behavior and the servers to which it should forward requests.

Features

Configuration

TinyLoadbalancer expects a path to a config.json file that defines its configuration. (See config.json for an example configuration.)

{
  "port": 3333,
  "strategy": "weighted-round-robin",
  "healthCheckInterval": "30s",
  "retryRequests": true,
  "servers": [
    {
      "url": "http://localhost:8081",
      "weight": 5
    },
    {
      "url": "http://localhost:8082",
      "weight": 3
    },
    {
      "url": "http://localhost:8083",
      "weight": 2
    }
  ]
}

Configuration Fields

Run locally

Testing