> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ultrabalancer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Health Checks

> Backend health monitoring and circuit breaker

## Overview

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

## Configuration

```yaml theme={null}
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.

```yaml theme={null}
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

```yaml theme={null}
# 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`:

```js theme={null}
app.get('/health', (req, res) => {
  res.status(200).json({ status: 'healthy' });
});
```

## Check Status

```bash theme={null}
# Via metrics
curl http://localhost:8080/metrics

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

## Related

* [Monitoring](/integration/monitoring) - Grafana dashboards
* [Algorithms](/concepts/algorithms) - Health-aware routing
