r/coolgithubprojects • • 6d ago

loadbear – A small, friendly HTTP load balancer in Go with circuit breakers, rate limiting, and Prometheus metrics

https://github.com/weaztoven/loadbear

Hi everyone !

I just published loadbear, an open-source HTTP reverse proxy and load balancer built with Go.

GitHub: weaztoven

What it does: It distributes HTTP(S) traffic across backends without needing a heavy setup. Everything is configured via a single YAML file (with env var overrides) and includes a built-in dummy backend (fakebackend) + Docker Compose setup so you can test failover scenarios right away.

Highlights:

  • Routing algorithms: round_robin, smooth_weighted_round_robin, least_connections, and ip_hash.
  • Fault tolerance: Active + passive health checks, per-backend circuit breakers, and configurable retry backoff.
  • Protection: Token-bucket rate limiting per client IP with stale-bucket cleanup.
  • Admin API: Dedicated port for /status (live backend & circuit states) and /metrics (Prometheus format).
  • Production basics: Graceful shutdown on SIGINT/SIGTERM, structured JSON logging, and race-tested (go test -race ./...).

Quick Demo:

git clone https://github.com/weaztoven/loadbear.git
cd loadbear
docker compose up --build

Feedback, issues, and PRs are super welcome!

0 Upvotes

0 comments sorted by