Scaling Your Application

In a Platform as a Service (PaaS) environment such as Scalingo, scaling refers to adjusting the application’s capacity to handle varying workloads. We usually distinguish two different approaches: vertical scaling and horizontal scaling.

Understanding Scaling

Vertical Scaling

Vertical scaling involves increasing (scaling up) or decreasing (scaling down) the capacity of a single resource, such as CPU, memory, or storage of an existing server or container.

When using Scalingo, vertical scaling is accomplished by changing the plan you are using (e.g. switching your app container from a L instance to an XL one, or changing your database addon’s plan from a Starter 512M to a Starter 1G).

Vertical scaling is generally favored when dealing with legacy applications that aren’t designed for distributed workloads, or for monolithic applications with predictable growth and resource needs.

Horizontal Scaling

Horizontal scaling involves adding (scaling out) or removing (scaling in) instances of a resource to distribute the workload across all these instances. When using Scalingo, horizontal scaling is accomplished by either booting additional containers or by removing running ones.

The platform automatically routes the traffic to the available instances. This process, called load balancing, allows to evenly distribute the load across multiple containers.

Horizontal scaling has multiple advantages:

  • it adds fault tolerance and resilience to your application, as the failure of one instance does not affect others.
  • it can scale almost infinitely, allowing your application to grow fast.
  • it can save costs, as the number of running containers can be automatically adjusted (up and down) depending on your current application needs.

For all these reasons, horizontal scaling is generally better suited for applications with distributed architectures that require high availability, and the ability to adapt to unpredictable or fluctuating workloads. It’s often the best approach in PaaS environments such as Scalingo.

Choosing Between Vertical and Horizontal Scaling

Both forms of scaling are complementary. You will often need to combine both horizontal (scale out/in) and vertical scaling (scale up/down) to adapt your application to traffic fluctuations.

Here is a quick comparison table, in the context of a Platform as a Service:

  Vertical Scaling Horizontal Scaling
Approach Enhancing individual instance capacity Adding more instances
Cost Can become expensive at higher limits Often more cost-efficient
Resilience Low (single point of failure) High (distributed resources)
Flexibility Low, limited by physical/virtual constraints High, limited by the application architecture
When Lack or overuse of CPU or RAM (swap increase or decrease) Increase or decrease in total application traffic

Limitations

  • Vertical scaling is limited by the platform. The biggest container we can currently boot is the 2XL container, with 4GB of RAM. For a comprehensive list of container sizes and corresponding specifications, please see our dedicated documentation page.
  • Horizontal scaling is limited by default to a maximum of 10 containers per process type. This limit can be increased via our support team.

Costs

Scaling operations themselves are free, meaning there is no additional charge for changing the number or size of containers. However, scaling affects the number or size of allocated resources, which in turn impacts the total cost of your application.

Scaling Vertically

Using the Dashboard

  1. From your web browser, open your dashboard
  2. Click on the application you want to scale up or down
  3. Click on the Resources tab
  4. Locate the Containers block
  5. Next to the process type you want to scale up/down, locate the Size dropdown
  6. From the dropdown, select the new size for the corresponding container(s)
  7. Click the Scale button on the right side

Using the Command Line

  1. Make sure you have correctly setup the Scalingo command line tool
  2. From the command line, run the following command to view the current formation:
    scalingo --app my-app scale
    

    The output should look like this:

    +--------+--------+------+---------+
    |  NAME  | AMOUNT | SIZE | COMMAND |
    +--------+--------+------+---------+
    | web    |      1 | M    | -       |
    +--------+--------+------+---------+
    

    In the example above, the application runs with one web container of size M.

  3. From the command line, run the following command to scale up to a XL container:
    scalingo --app my-app scale web:1:XL
    

    The output should look like this:

    Your application is being scaled to:
      web: 1 - XL
    

Using the Terraform Provider

  1. Set the size value of the scalingo_container_type resource block in your Terraform file to define the size of the container(s) running the corresponding process type:
    resource "scalingo_container_type" "web" {
      app    = scalingo_app.my_app.name
      name   = "web"
      amount = 1
      size   = "XL"
    }
    

    In this example, we ask the platform to use XL container(s) to run the web process type.

Scaling Horizontally

Using the Dashboard

  1. From your web browser, open your dashboard
  2. Click on the application you want to scale out or in
  3. Click on the Resources tab
  4. Locate the Containers block
  5. Next to the process type you want to scale up/down, locate the Qty dropdown
  6. From the dropdown, select the number of container(s) to start
  7. Click the Scale button on the right side

Using the Command Line

  1. Make sure you have correctly setup the Scalingo command line tool
  2. From the command line, run the following command to view the current formation:
    scalingo --app my-app scale
    

    The output should look like this:

    +--------+--------+------+---------+
    |  NAME  | AMOUNT | SIZE | COMMAND |
    +--------+--------+------+---------+
    | web    |      1 | M    | -       |
    +--------+--------+------+---------+
    

    In the example above, the application runs with 1 web container of size M.

  3. From the command line, run the following command to scale out to 5 web containers of size M:
    scalingo --app my-app scale web:5:M
    

    The output should look like this:

    Your application is being scaled to:
      web: 5 - M
    

Using the Terraform Provider

  1. Set the amount value of the scalingo_container_type resource block in your Terraform file to define the size of the container(s) running the corresponding process type:
    resource "scalingo_container_type" "web" {
      app    = scalingo_app.my_app.name
      name   = "web"
      size   = "M"
      amount = 5
    }
    

    In this example, we ask the platform to start 5 containers running the web process type.

Monitoring Scaling Events

The following event is available to monitor the scaling operations:

Event Description
app_scaled A scaling operation (scale in and scale out) has been triggered

To learn more about events and notifications, please visit the page dedicated to app notifications.


Suggest edits

Scaling Your Application

©2025 Scalingo