Environment Configuration
Required Variables
SECRET_KEY_BASE
- Minimum 64 bytes
- Keep secret (never commit to version control)
- Use same value across all nodes in a cluster
PHX_HOST
- Single region:
rpc.example.com - Multi-region:
us-east-1.rpc.example.com,eu-west-1.rpc.example.com
PHX_SERVER
LASSO_NODE_ID
- Unique per node
- Stable (don’t change after deployment)
- Convention: use region names for geo-distributed deployments
us-east-1,eu-west-1,ap-southeast-1(cloud regions)iad,lhr,sin(datacenter codes)production-1,staging-1(environment-based)
PORT (optional)
4000Set custom port:Provider API Keys
Identify required providers
${ENV_VAR} placeholders:Set provider API keys
Validate startup
${ENV_VAR} placeholders are unresolved.Test locally:Clustering (Optional)
Set clustering variables (if clustering)
Verify DNS resolution
Test node connectivity
Profile Configuration
Validate Profile YAML
Check profile syntax
Verify required fields
name: Display nameslug: URL-safe identifierchains: At least one chain with providers
Test profile loading
Rate Limits
Configure rate limits
Test rate limiting
Health Checks
Configure Health Endpoint
Test health endpoint
Configure orchestrator health checks
TLS/HTTPS
Terminate TLS at Load Balancer
Configure reverse proxy
- AWS ALB: Configure HTTPS listener with ACM certificate
- GCP Load Balancer: Use Google-managed certificates
- Azure Application Gateway: Configure SSL termination
Set PHX_HOST to HTTPS domain
Test HTTPS
Logging
Structured JSON Logs
Verify JSON logging
Configure log aggregation
Set up log monitoring
- High error rates
- Circuit breaker openings
- Provider failures
- Slow response times (P95/P99)
Monitoring
Dashboard Access
Verify dashboard
Secure dashboard access (production)
Metrics Collection
Enable VM metrics (if needed)
Monitor key metrics
- Requests per second (total and per provider)
- Latency (P50, P95, P99)
- Error rate
- Circuit breaker state
- CPU usage
- Memory usage
- BEAM scheduler utilization
- Process count
- Provider availability
- Provider latency
- Circuit breaker trips
- Failover rate
Network & Firewall
Port Configuration
Open required ports
- 4000 (HTTP, configurable via
PORT)
- 4000 (HTTP)
- 4369 (EPMD)
- 9000-9999 (Erlang distribution, configurable)
Configure firewall rules
- Allow: Public (or application subnets)
- Allow: Only cluster nodes (internal network)
- Deny: Public internet
Capacity Planning
Resource Allocation
Estimate request volume
- 1000 users
- 10 requests per user per minute
- = 167 RPS
Size compute resources
- 1 vCPU per 500 RPS (approximate)
- Example: 334 RPS → 2 vCPUs
- Base: 512MB
- Add 256MB per 1000 RPS
- Example: 334 RPS → 1GB
- Minimal (logs only, unless persisting metrics)
- 10GB should suffice
Test under load
- Response time (P95, P99)
- Error rate
- CPU/memory usage
Disaster Recovery
Backup Configuration
Backup profile files
Document environment variables
- AWS Secrets Manager
- HashiCorp Vault
- Kubernetes Secrets
Failover Testing
Test provider failover
Test node failure (if clustered)
Pre-Launch Checklist
Complete verification before production launch:Environment
-
SECRET_KEY_BASEset (64+ bytes) -
PHX_HOSTset to public hostname -
PHX_SERVER=trueset -
LASSO_NODE_IDset to unique, stable value -
PORTconfigured (if not using 4000) - Provider API keys set for all
${ENV_VAR}in profiles - If clustering:
CLUSTER_DNS_QUERYandCLUSTER_NODE_BASENAMEset - If clustering: DNS resolution verified
- If clustering: Erlang distribution ports open between nodes
Configuration
- Profile YAML validated (no syntax errors)
- Profile YAML startup tested (no unresolved
${ENV_VAR}) - Rate limits configured in profile frontmatter
- Provider capabilities defined (or defaults accepted)
- Circuit breaker thresholds reviewed (or defaults accepted)
Infrastructure
- Health check (
GET /api/health) monitored by orchestrator/LB - TLS terminated at reverse proxy or load balancer
- Firewall rules configured (4000 public, 4369/9000+ internal only)
- Load balancer configured (if multiple nodes per region)
- GeoDNS/anycast configured (if multi-region)
Observability
- Structured JSON logs verified
- Log aggregation configured (Fluentd, CloudWatch, etc.)
- Dashboard access secured (auth, VPN, or internal-only)
- Metrics monitoring configured (CPU, memory, RPS, latency)
- Alerts configured (high error rate, circuit breaker, slow response)
Testing
- Load testing completed (verify RPS capacity)
- Provider failover tested (circuit breaker triggers correctly)
- Rate limiting tested (429 responses after exceeding limit)
- If clustered: Node failure tested (dashboard shows :disconnected)
- If multi-region: Regional failover tested (GeoDNS/LB routes correctly)
Documentation
- Runbook created (restart procedures, troubleshooting)
- Environment variables documented in secrets manager
- Profile configuration backed up
- On-call team trained (dashboard usage, common issues)
Post-Launch Monitoring
Monitor these metrics in the first 24-48 hours:- Request volume: Verify within expected range
- Error rate: Should be <1%
- Latency: P95/P99 within acceptable thresholds
- Circuit breaker trips: Investigate any provider issues
- Memory/CPU: Verify resources are adequate
- Log errors: Review for unexpected issues
Next Steps
- Docker Deployment - Containerized deployment guide
- Clustering - Multi-node setup
- Geo-Distributed - Multi-region architecture