Resource Sizing
Guidelines for sizing your Laminar deployment based on workload requirements.
Overview
Proper resource sizing ensures:
- Performance - Adequate resources for throughput
- Stability - Avoiding OOM kills and CPU throttling
- Cost efficiency - Not over-provisioning
- Scalability - Room for growth
Quick Reference
| Deployment Size | Events/sec | API | Controller | Workers | RocksDB Storage | Nodes |
|---|---|---|---|---|---|---|
| Development | < 1K | 1x 256Mi | 1x 512Mi | 1x 2Gi | 5Gi | 1 |
| Small | 1K-10K | 2x 512Mi | 2x 1Gi | 2-4x 4Gi | 20Gi | 3 |
| Medium | 10K-100K | 3x 1Gi | 2x 2Gi | 4-8x 8Gi | 50Gi | 5 |
| Large | 100K-1M | 5x 2Gi | 3x 4Gi | 8-16x 16Gi | 200Gi | 10+ |
Component Sizing
API Server
The API server handles HTTP requests and WebSocket connections.
api:
replicas: 2
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 1000m
memory: 1GiController
The controller manages pipeline orchestration and scheduling with embedded RocksDB.
controller:
replicas: 2
resources:
requests:
cpu: 250m
memory: 1Gi
limits:
cpu: 1000m
memory: 2Gi
persistence:
size: 20Gi
storageClass: gp3
checkpointInterval: "30s"
maxParallelism: 16Workers
Workers execute pipeline tasks and are the most resource-intensive component.
worker:
replicas: 2
resources:
requests:
cpu: 1000m
memory: 4Gi
limits:
cpu: 2000m
memory: 8Gi
taskSlots: 4Storage Sizing
RocksDB (Local State)
RocksDB storage requirements depend on pipeline state size:
| Workload | Storage | IOPS | Storage Class |
|---|---|---|---|
| Development | 5-10 Gi | 3000 | standard |
| Small | 20-50 Gi | 3000 | gp3 |
| Medium | 50-100 Gi | 6000 | gp3 |
| Large | 200-500 Gi | 10000+ | io2 |
Object Storage (Checkpoints & Artifacts)
Estimate checkpoint and artifact storage:
| Metric | Formula |
|---|---|
| Checkpoints | pipelines × checkpoint_interval × retention |
| Artifacts | pipeline_runs × avg_artifact_size |
Example:
- 10 pipelines, 10s checkpoints, 7 days retention
- 10 × 8640 × 7 ≈ 600K checkpoints
- At ~1MB each ≈ 600 GB
Node Sizing
AWS Instance Types
| Size | Instance Type | vCPU | Memory | Use Case |
|---|---|---|---|---|
| Dev | t3.medium | 2 | 4 GB | Development |
| Small | m5.xlarge | 4 | 16 GB | Light production |
| Medium | m5.2xlarge | 8 | 32 GB | Standard production |
| Large | m5.4xlarge | 16 | 64 GB | Heavy workloads |
| Worker | c5.2xlarge | 8 | 16 GB | CPU-intensive |
GCP Machine Types
| Size | Machine Type | vCPU | Memory |
|---|---|---|---|
| Dev | e2-medium | 2 | 4 GB |
| Small | e2-standard-4 | 4 | 16 GB |
| Medium | e2-standard-8 | 8 | 32 GB |
| Large | e2-standard-16 | 16 | 64 GB |
Azure VM Sizes
| Size | VM Size | vCPU | Memory |
|---|---|---|---|
| Dev | Standard_D2s_v3 | 2 | 8 GB |
| Small | Standard_D4s_v3 | 4 | 16 GB |
| Medium | Standard_D8s_v3 | 8 | 32 GB |
| Large | Standard_D16s_v3 | 16 | 64 GB |
Autoscaling
Horizontal Pod Autoscaler
api:
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70
targetMemoryUtilizationPercentage: 80
worker:
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 20
targetCPUUtilizationPercentage: 70Cluster Autoscaler
Enable cluster autoscaling to add/remove nodes:
# EKS
eksctl create cluster ... --asg-access
# GKE
gcloud container clusters create ... --enable-autoscaling
# AKS
az aks create ... --enable-cluster-autoscalerPerformance Testing
Load Testing
# Generate test load
hey -n 10000 -c 100 http://laminar.example.com/api/health
# Monitor during test
kubectl top pods -n laminar
kubectl top nodesKey Metrics to Monitor
| Metric | Target | Action if Exceeded |
|---|---|---|
| API latency (p99) | < 100ms | Add replicas |
| CPU utilization | < 70% | Scale horizontally |
| Memory utilization | < 80% | Increase limits |
| Pipeline lag | < 1s | Add workers |
| RocksDB disk usage | < 80% | Expand PVC |
Cost Optimization
Reserved Capacity
Use reserved instances/committed use for stable workloads:
- 1-year commitment: ~30% savings
- 3-year commitment: ~50% savings
Spot/Preemptible Instances
Use for workers (with proper checkpointing):
worker:
nodeSelector:
node-type: spot
tolerations:
- key: "spot"
operator: "Equal"
value: "true"
effect: "NoSchedule"Sizing Checklist
- Identified workload characteristics (events/sec, pipeline count)
- Calculated storage requirements (RocksDB + object storage)
- Selected appropriate node types
- Configured resource requests and limits
- Enabled autoscaling for variable workloads
- Set up monitoring for resource utilization
- Tested under expected load
Next Steps
- High Availability - HA configuration
- Backup & Restore - Data protection
- Troubleshooting - Common issues