Sail

Clusters

Clusters define groups of backend destinations and their load balancing policies.

Cluster Configuration

{
  "id": "backend-cluster",
  "destinations": {
    "backend-1": {
      "address": "https://api1.example.com"
    },
    "backend-2": {
      "address": "https://api2.example.com"
    }
  },
  "loadBalancingPolicy": "RoundRobin"
}

Load Balancing Policies

RoundRobin

Distributes requests evenly across all destinations in sequence.

LeastRequests

Routes to the destination with the fewest active requests.

Random

Randomly selects a destination for each request.

PowerOfTwoChoices

Picks two random destinations and chooses the one with fewer active requests.

Health Checks

Configure health checks to automatically remove unhealthy destinations:

{
  "id": "backend-cluster",
  "destinations": { ... },
  "healthCheck": {
    "active": {
      "enabled": true,
      "interval": "00:00:10",
      "timeout": "00:00:05",
      "path": "/health"
    }
  }
}

See also