Skip to main content

YAML Format

listen_address: "0.0.0.0"
listen_port: 8080
algorithm: "round-robin"
workers: "auto"
max_connections: 10000

backends:
  - host: "192.168.1.10"
    port: 8080
    weight: 100
    max_connections: 1000
  - host: "192.168.1.11"
    port: 8080
    weight: 150
    max_connections: 1500

TOML Format

listen_address = "0.0.0.0"
listen_port = 8080
algorithm = "round-robin"
workers = "auto"
max_connections = 10000

[[backends]]
host = "192.168.1.10"
port = 8080
weight = 100

[[backends]]
host = "192.168.1.11"
port = 8080
weight = 150

All Options

Listener

OptionTypeDefault
listen_addressstring"0.0.0.0"
listen_portinteger8080
workersstring/int"auto"
max_connectionsinteger10000

Algorithm

OptionTypeDefault
algorithmstring"round-robin"
Options: round-robin, least-connections, ip-hash, random, weighted, power-of-two, fastest-response

Backends

OptionTypeDefault
hoststringrequired
portintegerrequired
weightinteger100
max_connectionsinteger1000

Health Check

health_check:
  enabled: true
  interval_ms: 5000
  timeout_ms: 2000
  max_failures: 3
  path: "/health"

Circuit Breaker

health_check:
  circuit_breaker:
    enabled: true
    failure_threshold: 5
    success_threshold: 2
    timeout_seconds: 60

Caching

cache:
  enabled: true
  max_size: 10000
  default_ttl_seconds: 300

Compression

compression:
  enabled: true
  algorithm: "gzip"  # gzip, brotli, zstd
  min_size: 1024

Rate Limiting

rate_limit:
  enabled: true
  requests_per_second: 10000
  per_ip_rps: 100
  burst: 50

IP Filtering

ip_filter:
  whitelist:
    - "10.0.0.0/8"
  blacklist:
    - "192.168.1.100"

Sticky Sessions

sticky_sessions:
  enabled: true
  cookie_name: "ULTRABALANCER_SESSION"
  ttl_seconds: 3600

Retry

retry:
  enabled: true
  max_attempts: 3
  backoff_ms: 100
  max_backoff_ms: 5000

Access Log

access_log:
  enabled: true
  path: "/var/log/ultrabalancer/access.log"
  format: "json"  # or "combined"

TLS

tls:
  enabled: true
  cert_path: "/etc/ultrabalancer/cert.pem"
  key_path: "/etc/ultrabalancer/key.pem"
  min_version: "1.2"

Logging

logging:
  level: "info"   # trace, debug, info, warn, error
  format: "text"  # or "json"
  output: "stdout"  # or file path

Metrics

metrics:
  enabled: true
  endpoint: "/metrics"
  prometheus_endpoint: "/prometheus"

Environment Variable Substitution

listen_port: ${LISTEN_PORT}
backends:
  - host: "${BACKEND_HOST}"
    port: ${BACKEND_PORT}

Validate

ultrabalancer validate -c config.yaml