How to Configure Autoscaling on DigitalOcean App Platform
DigitalOcean App Platform supports CPU-based autoscaling for components with dedicated instances, automatically adjusting instance counts between min/max based on average CPU utilization exceeding a threshold like 80%. Configure via Control Panel UI by enabling autoscaling in component settings or edit appspec.yaml with autoscaling block and deploy using doctl or UI upload. Scaling clones deployments without full rebuilds, optimizing for variable traffic.
Prerequisites
- Existing App Platform app with dedicated instances (Pro plan or higher)
- Access to DigitalOcean Control Panel or doctl CLI
- Familiarity with App Platform components (web services or workers)
- Git repo or Docker image deployed as a service/worker
- Basic YAML editing skills for appspec method
Step-by-Step Instructions
Verify Prerequisites and Plan Selection
professional-xs or basic-1gb slugs), as Basic/shared plans do not support autoscaling. Check in the Control Panel under Apps > your app > Components; upgrade instance size if needed via Settings > Resource Size > Edit.Access App Dashboard via Control Panel
Enable Autoscaling in UI
Save UI Changes and Monitor
Download Current App Spec (Alternative Method)
appspec.yaml. Open locally in a text editor.Edit App Spec for Autoscaling
services or workers), remove or comment instance_count, ensure instance_size_slug is dedicated, and add autoscaling block: name: my-service
instance_size_slug: professional-xs
autoscaling:
min_instance_count: 2
max_instance_count: 10
metrics:
cpu:
percent: 80 Save the file.Deploy Updated App Spec via UI
appspec.yaml. Confirm and deploy; changes apply without full rebuild.Deploy via CLI (doctl)
brew install doctl; doctl auth init), then run doctl apps update <app-id> --app-spec appspec.yaml. Get <app-id> via doctl apps list. Verify with doctl apps describe <app-id>.Test and Tune Autoscaling
Review Costs and Metrics
Common Issues & Troubleshooting
Autoscaling option unavailable or grayed out
Switch to dedicated instances (Pro plan, e.g., professional-xs slug) in component Settings > Resource Size; Basic/shared plans do not support it.
Scaling triggers full rebuild (5-10 min delay)
Ensure using modern CPU-based autoscaling (not legacy manual); it clones deployments. Update via appspec or UI; avoid changing instance_count directly.
Instances not scaling despite high CPU
Verify average CPU across all instances exceeds threshold; check min/max limits reached. Lower threshold or increase max_instance_count; ensure even traffic distribution.
App spec upload or doctl update fails
Validate YAML syntax (no tabs, proper indentation); confirm dedicated slug and remove conflicting instance_count. Check doctl auth and app-id.
Frequent scale up/down flapping
Raise CPU threshold slightly or increase min_instance_count; monitor for consistent load patterns before tuning.