Skip to main content
This guide covers scaling Enclave for high-throughput workloads, from single-server optimization to distributed multi-pod deployments.

Scaling Dimensions

Single-Server Scaling

Worker Pool

For CPU-bound workloads, use the worker pool adapter:

Pool Sizing Guidelines

Enclave Pooling

Reuse Enclave instances to avoid initialization overhead:

Distributed Scaling

Architecture

Broker Configuration

Runtime Configuration

Client Configuration

Redis Configuration

Session State

Redis Cluster

For high availability:

Kubernetes Scaling

Horizontal Pod Autoscaler

Pod Disruption Budget

Resource Quotas

Load Balancing

Sticky Sessions

For WebSocket connections:

Runtime Routing

Route to specific runtimes based on workload:

Performance Benchmarks

Single Server (8 cores, 16GB RAM)

Distributed (3 runtime pods)

Monitoring at Scale

Key Metrics

Alerting Rules

Best Practices

  1. Start simple - Use worker pool before going distributed
  2. Monitor queue depth - Scale based on pending executions
  3. Set memory limits - Prevent runaway scripts
  4. Use connection pooling - Reuse Redis/DB connections
  5. Implement backpressure - Reject requests when overloaded
  6. Regional deployment - Deploy runtimes close to users
  7. Graceful degradation - Fallback when components fail