Skip to content

loadbear v0.1.0

Choose a tag to compare

@weaztoven weaztoven released this 12 Nov 13:15
· 19 commits to main since this release

First public release of loadbear, a small, friendly load balancer written in Go.

Features

  • Reverse proxy with request ID propagation and forwarded headers
  • Four balancing strategies: round robin, smooth weighted round robin, least connections and IP hash
  • Active health checks with healthy/unhealthy thresholds, plus passive detection on proxy errors
  • Retries for idempotent requests (GET, HEAD, OPTIONS) on upstream errors, with configurable backoff
  • Per-backend circuit breaker
  • Per-IP token-bucket rate limiting with 429 and Retry-After
  • YAML configuration with LOADBEAR_LISTEN and LOADBEAR_LOG_LEVEL overrides
  • Separate admin listener with /status and /metrics (Prometheus text format)
  • Structured access logs and graceful shutdown
  • Multi-stage Dockerfile and a Docker Compose demo

Quick start

go run ./cmd/fakebackend --port 8081 --name b1
go run ./cmd/fakebackend --port 8082 --name b2
go run ./cmd/fakebackend --port 8083 --name b3
go run ./cmd/loadbear --config examples/config.example.yaml

Or run everything with docker compose up --build.

Known limitations

  • WebSocket upgrades are not verified and should be treated as unsupported.
  • SIGHUP hot reload is not implemented.
  • Metrics are a small hand-written Prometheus text endpoint, not a full client implementation.
  • No load or performance benchmarks are provided yet.

See the README for configuration details.