Skip to main content

Scalability

You can scale an application’s resources by changing the instance size (vertical scaling) or increasing the number of instances that simultaneously run your application (horizontal scaling).

warning

If you add persistent storage to your application’s web or background processes, those processes are limited to one instance each. There is no horizontal scaling for web or background processes with persistent storage, but you can vertically scale them by increasing the instance size for the process. You cannot add persistent storage or horizontal scaling to a cron job or job.

  • Vertical scaling gives instances more power to complete resource-intensive tasks.
  • Horizontal scaling improves resilience and load balancing for applications that process many requests. For example, if you run three versions of the same instance, the underlying technology routes requests to one of the three instances, effectively distributing the load between them. If one instance becomes unstable, requests will route to the other two until the third instance is healthy again.

Manual scaling

To change the instance size of a process, go to Sevalla > Applications > app name > Processes. Click the ellipsis > Update process.

Edit an application process in Sevalla.

Edit an application process in Sevalla.

Update the Instance size to increase the resources available to a single instance (vertically scale), or update the Instance count to add instances and improve the load balance (horizontally scale). There is a maximum of 20 instances and all instances use the same size.

Note: If you choose the Hobby instance size for your web process, you will not be able to add a custom domain to your application. If you need a custom domain for your application, you can upgrade your web process to a larger instance size anytime.

Change instance size, instance count, and horizontal autoscaling for a process.

Change instance size, instance count, and horizontal autoscaling for a process.

Once you have made your changes, click Update to finish updating the process and trigger a new deployment of the application. The updated process costs are added to your monthly invoice and are prorated for the first month. 

Automatic horizontal scaling

Horizontal autoscaling can be enabled for a stateless web process or background worker within Processes (Sevalla > Applications > app name > Processes). When you enable horizontal autoscaling, you’ll define a minimum and maximum number of instances you want the process to use. Note: The maximum number of instances cannot exceed 20.

When horizontal autoscaling is enabled, if the CPU usage on the current instance(s) reaches 80% of the available CPU resources, the process automatically increases by one, up to the maximum number you’ve set.

If the CPU usage decreases and the current number of instance(s) is no longer needed, the number of instances is reduced to what is needed. The instance count will not go lower than the minimum number you’ve set for horizontal autoscaling.

While there currently isn’t a way in Sevalla to see how many instances are in use, behind the scenes, only the number of instances needed will be used. You will only be billed for the number of instances your application actually uses. For example, if the minimum instance is set to one and the maximum is set to five, but the application only uses one instance during the billing period, you will only be charged for that one instance. If the application uses more instances for part of the time during the billing period, you will only be billed for those additional instances for the time they are actually used.