Skip to content

Application scaling

Your application runs on one or more instances of the same size, behind the load balancer. Choose their size and number in the Scalability menu of the Console, or with clever scale. A single value keeps them fixed, a range lets Clever Cloud adapt them to the load: this is autoscaling.

Instance sizes

SizepiconanoXSSMLXL2XL3XL
vCPU1*1*124681216
Memory256 MiB512 MiB1 GiB2 GiB4 GiB8 GiB16 GiB24 GiB32 GiB

* pico and nano instances share their vCPU with a lower priority, and always build on a dedicated build instance. XS is the default size for new applications. The smallest size is pico, or nano for PHP, FrankenPHP, Static with Apache, and Docker applications.

Fixed size and number

Set one size and one number of instances to keep them fixed, whatever the load:

clever scale --flavor M --instances 2

A change of the size or of the number of instances starts a deployment right away.

Autoscaling

Clever Cloud monitors the CPU and memory usage of your instances. When it stays high for a few minutes, it scales your application up within the ranges you set, and scales it down when the load drops. Autoscaling absorbs lasting load increases, not short peaks.

Each change is a deployment. With zero downtime deployment, enabled by default, new instances start before the old ones stop. The activity of your application lists them as UPSCALE or DOWNSCALE, triggered by Monitoring/Scaling.

Vertical scaling

With a range of sizes, Clever Cloud replaces your instances with larger ones when the load increases, and with smaller ones when it decreases:

clever scale --min-flavor XS --max-flavor M

Horizontal scaling

With a range of numbers, Clever Cloud adds instances next to the running ones when the load increases, and removes them when it decreases. An application can have up to 40 instances, or 20 when you set them with Clever Tools:

clever scale --min-instances 1 --max-instances 4

Both ranges

When you set both ranges, Clever Cloud first increases the size of your instances, up to the maximum size, then adds instances of this size. For instance, with sizes from XS to S and 1 to 2 instances, your application goes from one XS instance to one S instance, then to two S instances. When the load drops, Clever Cloud first removes the added instances, and keeps the larger size longer.

Autoscaling measures the usage of the whole instance. Code that runs on a single thread, such as the JavaScript of a Node.js process, only uses one vCPU. On a larger instance, this thread can reach its limit while the usage of the whole instance stays low: Clever Cloud may then not add instances. Run several processes, for instance with the cluster mode of Node.js, to use every vCPU of your instances.

With zero downtime deployment, a new deployment keeps the size and the number of instances that autoscaling reached.

Run on several instances

Each instance runs its own copy of your application, which changes a few things:

Clever Cloud bills each instance for the seconds it runs, within the ranges you set.

Last updated on