Tutorial

How to Auto-Scale Workloads Using Droplet Autoscale Pools

Published on April 3, 2025

Sr Technical Writer

How to Auto-Scale Workloads Using Droplet Autoscale Pools

Introduction

Handling unpredictable traffic spikes is a major challenge for applications. For developers, DevOps engineers, and system administrators managing web applications, e-commerce platforms, or SaaS solutions, this issue manifests when sudden increases in user activity overwhelm your infrastructure. Without proper scaling, high traffic can slow down services, increase latency, degrade user experience, or even cause complete downtime—resulting in lost revenue and damaged reputation.

This problem typically occurs during marketing campaigns, product launches, seasonal events, or when your content goes viral. Traditional solutions involve either over-provisioning resources (which wastes money during normal traffic periods) or manually scaling (which requires constant monitoring and can’t respond quickly enough to sudden spikes).

DigitalOcean’s Droplet Autoscale Pools provide a seamless way to automatically adjust infrastructure to meet demand. This solution monitors your application’s resource utilization in real-time and dynamically adds or removes computing resources based on predefined thresholds, ensuring optimal performance during peak times while minimizing costs during periods of lower activity.

In this tutorial, you’ll learn about the importance of auto-scaling with real-world examples, how to set up Droplet Autoscale Pools using both the DigitalOcean UI and CLI, configuring scaling rules and thresholds, best practices for optimizing auto-scaling, monitoring performance and benchmarking scaling efficiency, load testing to simulate real-world traffic spikes and observe autoscaling in action, determining the correct Autoscale Pool size, and FAQs on auto-scaling with DigitalOcean.

Understanding Auto-Scaling

Auto-scaling is a cloud computing feature that automatically adjusts the number of compute resources in a server pool based on the current demand. Instead of manually provisioning or deprovisioning servers, auto-scaling uses predefined rules to increase or decrease capacity as needed.

How Auto-Scaling Works

  1. Monitoring: The system continuously monitors resource metrics like CPU usage, memory utilization, or request rates.
  2. Evaluation: When these metrics cross predefined thresholds, scaling actions are triggered.
  3. Execution: New resources are automatically added during high demand (scaling out) or removed during low demand (scaling in).

Benefits of Auto-Scaling

  • Cost Optimization: Pay only for resources you need, when you need them.
  • Improved Performance: Maintain consistent performance even during traffic spikes.
  • Reduced Operational Overhead: Eliminate manual scaling and constant monitoring.
  • High Availability: Automatically replace unhealthy instances to maintain service reliability.
  • Scalability: Handle growth from hundreds to millions of users without infrastructure redesign.

Challenges and Considerations

  • Configuration Complexity: Setting appropriate thresholds requires testing and fine-tuning.
  • Boot Time: New instances take time to initialize, which may cause brief delays during rapid scaling.
  • Stateful Applications: Applications storing session data locally require additional considerations.
  • Cost Management: Improper configuration can lead to unnecessary scaling and increased costs.

Real-World Auto-Scaling Examples

Scenario 1: E-Commerce Traffic Spikes

Imagine an online store running a Black Friday sale. Traffic suddenly surges, causing slow response times. Without auto-scaling, customers face delays or checkout failures. With Droplet Autoscale Pools, the infrastructure automatically scales up, preventing downtime.

Scenario 2: SaaS Applications Handling Growth

A startup launches a new feature, leading to increased user sign-ups. Instead of manually provisioning new servers, autoscaling ensures the system adjusts dynamically based on real-time demand.

Prerequisites

Before you begin, make sure you have the following:

Step 1 - Create an Autoscale Pool

Droplet autoscale pools enable automatic horizontal scaling for a pool of Droplets based on resource utilization or a fixed size.

Create an Autoscale Pool using the Control Panel

From the DigitalOcean Control Panel, in the left menu, click Droplets, which has both a Droplets tab and an Autoscale Pools tab.

Autoscale Pool

Now click the Create an Autoscale Pool button on the Autoscale Pools tab to create a autoscale pool.

Create an Autoscale Pool

Autoscale Pool Configuration

In the Autoscale Pool Configuration section, you choose the configuration of the pool, which determines how the pool scales.

  1. Autoscale dynamically manages the number of Droplets in the pool based on their aggregate resource utilization. You choose:

    • Pool Size, which controls the minimum and maximum number of Droplets in the pool.

    • Target Utilization, which control which metrics (CPU, memory, or both) to monitor and at what thresholds to scale.

    • Cooldown Duration, which is the minimum amount of time the autoscale pool waits between making modifications to the Droplets in the pool. Choose a cooldown duration at least as long as it takes your Droplets to boot.

  2. Fixed Size maintains a fixed number of Droplets in the pool. You choose:

    • Number of Droplets. The quantity of Droplets you want in the pool.

Autoscale Pool Confuguration

In this tutorial, you will use the Autoscale configuration to automatically adjust the number of Droplets in the pool based on your pool size range and utilization metrics. It’s ideal for managing unpredictable traffic.

Choose the Pool Size, Target Utilization and Cooldown Duration

Now, let’s confugire the Pool size and the target utilization.

Set the Pool Size, target Utilization and cooldown duration

  1. In this example, you have set the Pool size to a minimum of 1 and maximum of 3 Droplets.
  2. We have set the Target CPU utilization to 40% and memory Utiization to 40%. When the metric goes above the target usage percentage, a Droplet will be automatically added to your autoscale pool. When it drops below, we’ll remove one.
  3. The cooldown duration is set to 5 minutes. It sets the minimum wait time between scaling events, ensuring new Droplets boot fully and utilization stabilizes before further adjustments.

Autoscale Pool Droplet Configuration

Now you will choose the configuration for Droplets in the autoscale pool. You can update this configuration at any time after creating the pool.

  1. Choose a base Droplet size, region, and image.

    Choose autoscale droplets Size

  2. Configure additional settings as needed, such as SSH keys, advanced options and the unique name.

    Choose authentication method

  3. Click the Create Autoscale Pool button on the top right.

    Create autoscale pool

You will now notice the Autoscale Pool being created and in an active state.

Autoscale pool successfully created

This will create one Droplet as specified in the Autoscale Pool configuration.

Autoscale Droplet created

Create an Autoscale Pool using CLI

You can also use the doctl command line utility to create, configure and manage an autoscale pool for your Droplet.

You can refer to this official documentation on how to install and configure doctl on your system.

Once doctl is installed you will need to create an API token.

To generate a personal access token, log in to the DigitalOcean Control Panel.

In the left menu, click API, which takes you to the Applications & API page on the Tokens tab. In the Personal access tokens section, click the Generate New Token button.

Generate New Token

Use the API token to grant doctl access to your DigitalOcean account. Pass in the token string when prompted by doctl auth init, and give this authentication context a name.

doctl auth init --context <NAME>

You will now be prompted to copy-paste your generated token.

Output
Please authenticate doctl for use with your DigitalOcean account. You can generate a token in the control panel at https://cloud.digitalocean.com/account/api/tokens ❯ Enter your access token: <TOKEN>

Now, use the below command to list the generated token has been successfully authenticated.

doctl auth list

You should get the token listed in the output:

Output
mytoken(current)

Note: Authentication contexts let you switch between multiple authenticated accounts. You can repeat the above steps to add other DigitalOcean accounts, then list and switch between authentication contexts:

doctl auth switch --context <NAME>

Now, to validate that doctl is working, you can run the following command from your command-line.

doctl account get
Output
User Email Team Droplet Limit Email Verified User UUID Status your_email@digitalocean.com CMS 10 true xxxxxx-xxxxx-xxxxxx-a80bb9d13dd8 active

Now, create an Droplet Autoscale pool using the below doctl command. You can check the complete command reference in this doctl compute droplet-autoscale guide.

The command is:

doctl compute droplet-autoscale create --name my-droplet-pool --image ubuntu-24-04-x64 --region blr1 --size s-1vcpu-1gb --min-instances 1 --max-instances 3 --cpu-target 40 --mem-target 40 --cooldown-minutes 5 --project-id <PROJECT_ID> --ssh-keys <SSH_KEY_ID>

This would create the same configuration Autoscale pool as generated in the above section from the DigitalOcean Cloud Control Panel.

You can refer to this official documentation on how the create an autoscale pool using doctl to learn more.

Step 2 - Load Testing to Test Autoscaling Performance

To simulate traffic spikes and observe autoscaling, you will use the loadtest tool to perform load testing on the Droplet. This will help you evaluate the performance of the autoscale pool under various load conditions.

SSH to your autoscale droplet and install loadtest.

sudo npm install -g loadtest

A load test is essentially a configuration of requests to simulate load on the system you want to test. This makes it very flexible and particularly good at implementing complex user flows. But it can do simple tests as well, so let’s start with that:

Here’s the command line command to perform load testing on your Droplet:

loadtest http://your-droplet-ip -n 1000 -c 10 -t 10m

This command will simulate 1000 requests with a concurrency of 10 to the specified Droplet IP over a period of 10 minutes. Adjust the parameters as needed to simulate different load scenarios.

In some time, you should notice new Droplets being created to handle the load once the Target CPU and memory utilization crosses the set threshold.

New Droplets Created

You can learn more about load testing and what frameworks to use for load testing on Ubuntu using this article on Introduction to load testing.

Determining the Correct Autoscale Pool Size

Choosing the right pool size depends on workload demands. Use these guidelines:

  1. Analyze Traffic Patterns: Monitor CPU usage trends to determine average and peak loads.

  2. Estimate Resource Needs: Start with a base pool and adjust based on load testing results.

  3. Consider Scaling Speed: Scaling up adds new instances, which take time to initialize.

Pools set to autoscale determine how many Droplets the pool should have by multiplying the utilization ratio by the current number of Droplets in the pool and taking the ceiling of the result.

For example, an autoscale pool with two Droplets, a target utilization of 80% CPU, and a current utilization of 95% CPU would perform the following calculation to determine the size of the pool:

ceil(2 Droplets * (95% current CPU / 80% target CPU))
= ceil(2 Droplets * 1.1875)
= ceil(2.375 Droplets)
= 3 Droplets

Therefore, this pool would scale up from two Droplets to three Droplets.

With multiple metrics set, the pool uses the largest result of this calculation across all metrics.

You can refer to DigitalOcean’s official guide for detailed autoscale pool sizing recommendations.

FAQs

1. How does DigitalOcean Autoscale Pools work?

DigitalOcean Autoscale Pools dynamically adjust the number of Droplets in a pool based on resource utilization or a fixed size. This is achieved through automatic horizontal scaling, ensuring that the pool size adapts to changing workload demands.

2. What is the minimum number of Droplets required?

A minimum of two Droplets is recommended for redundancy and smooth scaling. This allows for load distribution and ensures that the pool can scale up or down without downtime.

3. How fast does autoscaling respond to traffic spikes?

Autoscaling responds to traffic spikes by scaling up or down based on the Cooldown Duration. This time is necessary for new instances to initialize and become available. To minimize the impact of scaling latency, pre-warming is recommended.

The cooldown duration of the pool is the minimum amount of time the autoscale pool waits between making modifications to the Droplets in the pool.

This cooldown prevents thrashing during scaling. It also prevents downtime during configuration changes by giving new Droplets time to boot before destroying the old ones.

4. Can I use Autoscale Pools with a Load Balancer?

Yes, DigitalOcean Autoscale Pools can be used in conjunction with a DigitalOcean Load Balancer to ensure efficient traffic distribution across the pool. This combination enables your application to handle increased traffic and scale dynamically.

5. How do I monitor my autoscaling performance?

To monitor autoscaling performance, use DigitalOcean Autoscale Pools Tab on the Cloud Control Panel or the doctl compute droplet-autoscale list command. This provides insights into the current state of your autoscale pool and helps you optimize its configuration.

6. Can I manually adjust the number of Droplets in an Autoscale Pool?

Yes, you can manually adjust the number of Droplets in an Autoscale Pool using the DigitalOcean Control Panel or the CLI. This allows for fine-grained control over the pool size, enabling you to respond to changing workload demands.

7. What happens if my Droplet count hits the maximum limit?

If the Droplet count reaches the maximum limit set for the Autoscale Pool, no additional Droplets will be created. It is essential to set an appropriate maximum value to ensure that your pool can scale up to meet demand without exceeding resource constraints.

Conclusion

DigitalOcean’s Droplet Autoscale Pools provide a robust solution for handling unpredictable workloads and traffic patterns. By following this tutorial, you can configure autoscaling efficiently, optimize performance, and ensure smooth operation during traffic spikes without manual intervention.

Implementing best practices like using load balancers to distribute traffic, setting appropriate scaling thresholds based on your application’s performance characteristics, and configuring optimal cooldown periods will maximize the benefits of autoscaling on DigitalOcean.

The key advantages of implementing Droplet Autoscale Pools include:

  • Cost optimization: Pay only for the resources you need, when you need them.
  • Improved reliability: Automatically handle traffic spikes without service degradation.
  • Reduced operational overhead: Eliminate manual scaling and the need for constant monitoring.
  • Enhanced user experience: Maintain consistent performance regardless of the load.
  • Business agility: Quickly adapt to changing market conditions and seasonal demands.

For production workloads, consider implementing a comprehensive monitoring strategy using DigitalOcean Monitoring to gain deeper insights into your application’s performance and further refine your autoscaling configuration over time.

By leveraging DigitalOcean’s infrastructure and autoscaling capabilities, you can build resilient, scalable applications that deliver consistent performance while optimizing your cloud infrastructure costs.

Continue building with DigitalOcean Gen AI Platform.

About the author(s)

Anish Singh Walia
Anish Singh WaliaSr Technical Writer
See author profile
Category:
Tutorial
Tags:

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
Leave a comment
Leave a comment...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.