Skip to main content

Quick Config

CLI Arguments

ultrabalancer start round-robin backend1:8080 backend2:8080 \
  --port 8080 \
  --cache \
  --compression gzip

Config File (YAML)

Create config.yaml:
listen_address: "0.0.0.0"
listen_port: 8080
algorithm: "round-robin"

backends:
  - host: "192.168.1.10"
    port: 8080
    weight: 100
  - host: "192.168.1.11"
    port: 8080
    weight: 100
Run it:
ultrabalancer start -c config.yaml

Config Options

OptionDefaultDescription
listen_address0.0.0.0IP to bind to
listen_port8080Port to listen on
workersautoWorker threads (or number)
max_connections10000Max concurrent connections
OptionDefaultDescription
host-Backend hostname/IP (required)
port-Backend port (required)
weight100Weight for weighted algorithms
max_connections1000Max connections to this backend
OptionDefaultDescription
enabledtrueEnable health checking
interval_ms5000Check interval in ms
max_failures3Failures before marking unhealthy
path/HTTP path for checks
OptionDefaultDescription
enabledfalseEnable response caching
max_size10000Max cached responses
default_ttl_seconds300Default TTL
OptionDefaultDescription
enabledfalseEnable compression
algorithmgzipgzip, brotli, or zstd
min_size1024Min bytes to compress
OptionDefaultDescription
enabledfalseEnable rate limiting
requests_per_second1000Global RPS limit
per_ip_rps100Per-IP RPS limit
OptionDefaultDescription
enabledfalseEnable TLS termination
cert_path-Path to certificate (PEM)
key_path-Path to private key (PEM)

Complete Example

listen_address: "0.0.0.0"
listen_port: 443
algorithm: "least-connections"

backends:
  - host: "backend1.internal"
    port: 8080
    weight: 100
  - host: "backend2.internal"
    port: 8080
    weight: 100

health_check:
  enabled: true
  interval_ms: 3000
  max_failures: 3

cache:
  enabled: true

compression:
  enabled: true
  algorithm: "gzip"

rate_limit:
  enabled: true
  requests_per_second: 10000

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

Environment Variables

export ULTRA_LISTEN_ADDRESS="0.0.0.0"
export ULTRA_LISTEN_PORT="8080"
export ULTRA_ALGORITHM="round-robin"
export ULTRA_BACKENDS="backend1:8080,backend2:8080"

Validate Config

ultrabalancer validate -c config.yaml

Next Steps