Work in Progress: This page is under development. Use the feedback button on the bottom right to help us improve it.

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 SizeEvents/secAPIControllerWorkersRocksDB StorageNodes
Development< 1K1x 256Mi1x 512Mi1x 2Gi5Gi1
Small1K-10K2x 512Mi2x 1Gi2-4x 4Gi20Gi3
Medium10K-100K3x 1Gi2x 2Gi4-8x 8Gi50Gi5
Large100K-1M5x 2Gi3x 4Gi8-16x 16Gi200Gi10+

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: 1Gi

Controller

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: 16

Workers

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: 4

Storage Sizing

RocksDB (Local State)

RocksDB storage requirements depend on pipeline state size:

WorkloadStorageIOPSStorage Class
Development5-10 Gi3000standard
Small20-50 Gi3000gp3
Medium50-100 Gi6000gp3
Large200-500 Gi10000+io2

Object Storage (Checkpoints & Artifacts)

Estimate checkpoint and artifact storage:

MetricFormula
Checkpointspipelines × checkpoint_interval × retention
Artifactspipeline_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

SizeInstance TypevCPUMemoryUse Case
Devt3.medium24 GBDevelopment
Smallm5.xlarge416 GBLight production
Mediumm5.2xlarge832 GBStandard production
Largem5.4xlarge1664 GBHeavy workloads
Workerc5.2xlarge816 GBCPU-intensive

GCP Machine Types

SizeMachine TypevCPUMemory
Deve2-medium24 GB
Smalle2-standard-4416 GB
Mediume2-standard-8832 GB
Largee2-standard-161664 GB

Azure VM Sizes

SizeVM SizevCPUMemory
DevStandard_D2s_v328 GB
SmallStandard_D4s_v3416 GB
MediumStandard_D8s_v3832 GB
LargeStandard_D16s_v31664 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: 70

Cluster 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-autoscaler

Performance 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 nodes

Key Metrics to Monitor

MetricTargetAction if Exceeded
API latency (p99)< 100msAdd replicas
CPU utilization< 70%Scale horizontally
Memory utilization< 80%Increase limits
Pipeline lag< 1sAdd 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