Skip to main content

Overview

UltraBalancer automatically checks backend health and removes unhealthy backends from rotation.

Configuration

health_check:
  enabled: true
  interval_ms: 5000     # Check every 5 seconds
  timeout_ms: 2000      # 2 second timeout
  max_failures: 3       # Mark unhealthy after 3 failures
  path: "/health"       # Health check endpoint

Circuit Breaker

Prevents cascading failures when backends are struggling.
health_check:
  circuit_breaker:
    enabled: true
    failure_threshold: 5      # Open after 5 failures
    success_threshold: 2      # Close after 2 successes
    timeout_seconds: 60       # Try again after 60s
States:
  • Closed - Normal operation
  • Open - Failing fast, no traffic
  • Half-Open - Testing recovery

Quick Config

# Basic - for most cases
health_check:
  enabled: true
  interval_ms: 5000

# Aggressive - for critical services
health_check:
  enabled: true
  interval_ms: 2000
  max_failures: 2
  circuit_breaker:
    enabled: true
    timeout_seconds: 30

Backend Health Endpoint

Your backends should expose /health:
app.get('/health', (req, res) => {
  res.status(200).json({ status: 'healthy' });
});

Check Status

# Via metrics
curl http://localhost:8080/metrics

# Via admin API
curl http://localhost:8080/admin/backends