Repository navigation
loadbear v0.1.0
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
429andRetry-After - YAML configuration with
LOADBEAR_LISTENandLOADBEAR_LOG_LEVELoverrides - Separate admin listener with
/statusand/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.yamlOr 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.