How to Configure Autoscaling on DigitalOcean App Platform

intermediate 8 min read Updated 2026-03-24
Quick Answer

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.

Get DigitalOcean App PlatformPartner

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

1

Verify Prerequisites and Plan Selection

Ensure your App Platform app uses a Pro plan or higher with dedicated instances (e.g., 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.
Default CPU threshold is 80%; set min instances to 1-2 and max to 10 initially based on workload.
2

Access App Dashboard via Control Panel

Log in to the DigitalOcean Control Panel, navigate to Apps in the left sidebar, and select your app to open the App Dashboard. Locate the target component (e.g., web service or worker) in the Components section.
3

Enable Autoscaling in UI

Click the component, scroll to Settings, Scale, or Resources tab, then click Edit in the Resource Size or Instance Configuration section. Toggle Autoscaling or Autoscale on (only available for dedicated instances), then set Minimum Containers (e.g., 2), Maximum Containers (e.g., 10), and CPU Threshold (e.g., 80%).
Lower threshold scales earlier; higher min count improves traffic distribution even at high CPU.
4

Save UI Changes and Monitor

Click Save or Apply; the app redeploys if needed, cloning current deployment for new instances. Monitor scaling in the dashboard metrics; instances adjust automatically based on average CPU across containers.
5

Download Current App Spec (Alternative Method)

For precise control, in App Dashboard go to Settings > App Spec and click Download to get appspec.yaml. Open locally in a text editor.
Recommended for teams or CI/CD; avoids UI limitations.
6

Edit App Spec for Autoscaling

In the YAML, for your component (under 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.
Use <code>metrics.cpu.percent</code> format in newer specs; test with small ranges first.
7

Deploy Updated App Spec via UI

Back in App Dashboard > Settings > App Spec, click Upload and select your edited appspec.yaml. Confirm and deploy; changes apply without full rebuild.
8

Deploy via CLI (doctl)

Install/authenticate 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>.
Ideal for automation; API equivalent uses PUT /v2/apps/{id} with JSON spec.
9

Test and Tune Autoscaling

Simulate load (e.g., stress test endpoints) to trigger scaling; watch Metrics tab for CPU averages and instance count changes. Adjust threshold/min/max if scaling lags or over-scales; note scale-up clones deployments quickly.
Autoscaling monitors continuously; scale-down lags to avoid flapping.
10

Review Costs and Metrics

Check estimated Monthly App Cost range in UI (min to max instances). Use Insights/Metrics for CPU trends; optimize by increasing min instances for better distribution.

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.

Prices mentioned in this guide are pulled from current plan data and may change. Always verify on the official DigitalOcean App Platform website before purchasing.
Try Free

Affiliate link. We may earn a commission at no extra cost to you.