Quick Config
CLI Arguments
ultrabalancer start round-robin backend1:8080 backend2:8080 \
--port 8080 \
--cache \
--compression gzip
Config File (YAML)
Createconfig.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
ultrabalancer start -c config.yaml
Config Options
Listener
Listener
| Option | Default | Description |
|---|---|---|
listen_address | 0.0.0.0 | IP to bind to |
listen_port | 8080 | Port to listen on |
workers | auto | Worker threads (or number) |
max_connections | 10000 | Max concurrent connections |
Backends
Backends
| Option | Default | Description |
|---|---|---|
host | - | Backend hostname/IP (required) |
port | - | Backend port (required) |
weight | 100 | Weight for weighted algorithms |
max_connections | 1000 | Max connections to this backend |
Health Checks
Health Checks
| Option | Default | Description |
|---|---|---|
enabled | true | Enable health checking |
interval_ms | 5000 | Check interval in ms |
max_failures | 3 | Failures before marking unhealthy |
path | / | HTTP path for checks |
Caching
Caching
| Option | Default | Description |
|---|---|---|
enabled | false | Enable response caching |
max_size | 10000 | Max cached responses |
default_ttl_seconds | 300 | Default TTL |
Compression
Compression
| Option | Default | Description |
|---|---|---|
enabled | false | Enable compression |
algorithm | gzip | gzip, brotli, or zstd |
min_size | 1024 | Min bytes to compress |
Rate Limiting
Rate Limiting
| Option | Default | Description |
|---|---|---|
enabled | false | Enable rate limiting |
requests_per_second | 1000 | Global RPS limit |
per_ip_rps | 100 | Per-IP RPS limit |
TLS
TLS
| Option | Default | Description |
|---|---|---|
enabled | false | Enable 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
- CLI Reference - All commands
- File Config - YAML/TOML reference
- Examples - Real-world configs