Skip to content
id0n

Targets and balancing

Target groups, server weights, backups and balancing strategies.

A route forwards to a target group: one or more servers that can answer the request.

Balancing strategies

StrategyHow a server is chosen
Round robinEach server in turn. The default.
Weighted round robinIn turn, in proportion to each server's weight.
Least connectionsThe server with the fewest active connections.
IP hashConsistent hashing on the client IP, so a client keeps reaching the same server.
RandomA random server.

Weights and backups

  • Weight: a server with a higher weight receives more traffic. Default 1.
  • Backup: a backup server receives traffic only when the primary servers are unavailable.

Encrypted connections to targets

Gateway can connect to targets over TLS. It verifies the target's certificate and hostname by default.

Connection reuse

Gateway keeps a pool of connections to each target group and reuses idle connections. See Defaults.

Example

In the current Gateway configuration format, a target group with weighted servers and a balancing strategy looks like this. Strategy values are round_robin, weighted_round_robin, least_conn, ip_hash and random.

Example
{
  "upstreams": [
    {
      "name": "api",
      "load_balancer": "weighted_round_robin",
      "servers": [
        { "address": "10.0.0.1", "port": 8080, "weight": 1 },
        { "address": "10.0.0.2", "port": 8080, "weight": 2 }
      ]
    }
  ],
  "routes": [{ "path_prefix": "/api/", "upstream": "api" }]
}

Available at release

Which targets you can route to through id0n, and how you apply configuration, are published with the Gateway interface reference. Field names may change before release.

On this page

Ask AI

Answers come from the published id0n docs, with links to their sources.