Scaling & Capacity Planning
Plan and configure resources based on your concurrent scanning requirements.
Understanding Resource Units
Kubernetes uses specific units for CPU and memory:
| Unit | Meaning | Equivalent |
|---|---|---|
| m (millicores) | CPU measurement | 1000m = 1 CPU core |
| Mi (mebibytes) | Memory measurement | 1 Mi ≈ 1 MB |
| Gi (gibibytes) | Memory measurement | 1 Gi ≈ 1 GB |
For example, 200m CPU means 0.2 CPU cores (20% of one core), and 256Mi means about 256 MB of memory.
How Scanning Works
When a scan is triggered:
- Scan Scheduler receives the request and queues it in Redis
- Scan Manager picks up the job and creates an ephemeral Scan Worker pod
- A Chrome Instance pod is also created for crawling, and a second one when the scan uses recorded login
- Once the scan completes, the chrome instance pods are removed automatically but the worker pods are kept so their logs can be reviewed
Worker pods are kept for 24 hours, then removed by the Kubernetes TTL-after-finished controller.
Each scan-manager pod handles up to 5 concurrent scans.
Key formula: scan_manager_replicas × 5 = max concurrent scans
Component Resources
Static Components (Always Running)
These components run continuously regardless of scan activity:
- Scan Scheduler
- Scan Manager
- Chrome Controller
- Redis
Dynamic Components (Per Active Scan)
These pods are created on-demand for each running scan:
- Scan Worker
- Chrome Instance
Capacity Planning
Size your cluster from the number of concurrent scans you need:
- Scan Manager replicas =
ceil(concurrent_scans / 5) - Scan Worker: 1 CPU and 1 Gi memory limit per scan
- Chrome Instance: 2 CPU and 4 Gi memory limit per pod, plus a 2 Gi in-memory
/dev/shm
No cluster-wide cap: The software sets no overall limit on concurrent scans. Concurrency is bounded by scan-manager replicas (5 scans each), and each scan profile runs one scan at a time.
Node Autoscaling
Most managed Kubernetes services (EKS, AKS, GKE) support automatic node scaling. When enabled:
- Nodes are created on demand - When pods are scheduled, the autoscaler provisions nodes
- Right-sized instances - Selects appropriate instance types based on pod resource requests
- Horizontal scaling - Creates multiple smaller nodes rather than one large node
- Scale down - Terminates unused nodes when scans complete
You don’t need to pre-provision large nodes. The autoscaler handles it automatically.
Configuring Replicas
Configure replica counts and autoscaling in your Terraform module or Helm chart values. See the Terraform module configuration or Helm chart configuration for available variables.
Next Steps
- Troubleshooting - Monitoring, maintenance, and common issues