Skip to content

Releases

loadbear v0.4.0

Choose a tag to compare

@weaztoven weaztoven released this 15 Nov 14:59

Defaults unchanged. New opt-in proxy.circuit_count_tunnel_errors: tunnels that end with an upstream I/O error count as one circuit breaker failure. Clean upstream closes are never counted, because a normal WebSocket close handshake looks the same as a backend closing the tunnel at the TCP level. Test with your own WebSocket server before enabling it in production.

Added

  • Tunnel active gauges, duration histogram, and per-backend close-reason counters; ambiguous close causes are reported as unknown.
  • Opt-in proxy.circuit_count_tunnel_errors breaker accounting for upstream tunnel I/O errors only. Clean upstream closes are never counted because a normal WebSocket close handshake is indistinguishable at the TCP level; the feature defaults off.

loadbear v0.3.0

Choose a tag to compare

@weaztoven weaztoven released this 15 Nov 14:00

Behavior change: consecutive upstream 5xx responses now open the circuit breaker by default (previously they reset the failure count and the breaker never opened).

Changed

  • Behavior change: With the default empty proxy.circuit_failure_statuses, consecutive upstream 5xx responses now accumulate toward proxy.circuit_failure_threshold and open the circuit. They still do not mark the backend unhealthy or trigger status-based retries.
  • The reverse proxy reuses response-copy buffers to reduce per-request allocation observed in the profile benchmark; request and response behavior is unchanged.

Fixed

  • Upstream 5xx responses no longer reset the consecutive circuit-failure count before being recorded. Unlisted 429/404 responses remain non-failures.
  • A health check canceled while reloading settings no longer marks its backend unhealthy.

Added

  • SIGHUP reload of health-check path, interval, timeout, and healthy/unhealthy thresholds. Changed settings replace the checker loop without overlapping loops and preserve health flags for unchanged backends.
  • Opt-in admin.pprof_enabled profiling handlers on the admin listener and a reproducible proxy profile benchmark.
  • A Linux CI benchmark smoke test that runs loadgen through the proxy and checks request/error counts without performance thresholds.

loadbear v0.2.1

Choose a tag to compare

@weaztoven weaztoven released this 15 Nov 12:56

Added

  • Standard-library cmd/loadgen with bounded latency sampling and JSON/Markdown summaries.
  • Reproducible Linux/macOS and Windows benchmark scripts for direct-backend and proxy strategy scenarios.
  • proxy.circuit_failure_statuses to configure additional breaker failure statuses, with retries only for eligible requests before response commitment.
  • Graceful tracking and force-close of upgraded tunnels when shutdown grace expires.
  • Cumulative Prometheus latency buckets with _sum/_count, per-backend request/failure and circuit metrics, and a rate-limited counter.

Changed

  • Prometheus backend labels now use escaped backend values and stable backend ordering.
  • Backend request counters include each upstream attempt; terminal transport errors no longer double-count backend failures.

loadbear v0.2.0

Choose a tag to compare

@weaztoven weaztoven released this 15 Nov 10:31

Note: in v0.1.x, sending SIGHUP terminated the process. Upgrade if you rely on signals.

Added

  • Linux/macOS SIGHUP reload of backend URLs, weights and selection strategy. Unchanged backends keep their state (health, counters, circuit breaker) and in-flight requests are not interrupted. An invalid config is rejected and the running config is kept. Other settings (listen addresses, timeouts, health-check settings, rate limiting, logging) still require a restart.
  • Integration tests for HTTP/1.1 upgrade handshakes and bidirectional byte echo through the proxy.

Fixed

  • SIGHUP terminated the process instead of reloading. It is now handled separately from the shutdown signals.
  • Upgrade and Connection headers were stripped from every request, which broke WebSocket upgrades. They are now preserved for upgrade requests only; upgrade requests are never retried.
  • The access-log response wrapper did not implement http.Hijacker and http.Flusher, which prevented upgrade tunnels.
  • Backend lists held by the metrics and health-check components were read and written without synchronization.

loadbear v0.1.1

Choose a tag to compare

@weaztoven weaztoven released this 13 Nov 10:41

Breaking: rate_limit.trusted_proxy (bool) was replaced by rate_limit.trusted_proxies (list of IPs/CIDRs). The admin listener now binds to 127.0.0.1:9090 by default.

Fixed

  • Circuit breaker half-open state admitted unlimited concurrent probes; now exactly one, released on every exit path
  • Retries no longer happen for requests with non-replayable bodies or after a response has started
  • Retry backoff now respects the client's original deadline
  • X-Forwarded-For is only trusted from configured proxy addresses

Added

  • Fake backend modes: hang, close, drop-mid, slow
  • Regression tests for all of the above

loadbear v0.1.0

Choose a tag to compare

@weaztoven weaztoven released this 12 Nov 13:15

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.