Skip to content

DocsRun your app

Scaling

How much compute a replica has, how many replicas an app may run, how many requests a replica takes at once, and where the app runs.

Scaling has three parts: the size of one replica, the number of replicas, and the region. All three are under Settings, Scaling. A change applies with the next deployment.

The size is the CPU and memory of each replica. It is billed per second while the replica runs. A new app starts at Starter; change it here. The biggest size an app may pick depends on the plan: Starter on Hobby, Medium on Pro, Large on Business, see pricing.

A new size is charged from the deployment that applies it. Until then the app runs at the size it had, and is charged for that one.

Size CPU Memory
Starter 1 vCPU 512 MB
Small 1 vCPU 1 GB
Medium 2 vCPUs 2 GB
Large 4 vCPUs 4 GB

Start small. If the runtime log says the app ran out of memory, choose the next size.

A replica is one running copy of your app. Replicas sets how many may run at once.

Replicas start when traffic arrives and stop when it goes quiet. With a maximum of 3, a quiet app runs one replica, or none while it sleeps, and a busy one runs up to three.

How many replicas an app may have depends on your plan. See Pricing.

Another replica starts once every running one handles this many requests at the same time. Leave it empty and the size decides:

Size Requests at the same time
Starter 25
Small 25
Medium 50
Large 100

Lower it if each request is heavy. Raise it if requests are light and mostly wait. A replica takes up to twice the number; after that it answers nothing more until a request ends.

An open WebSocket or Socket.IO connection takes one of these places for as long as it stays open, so an app with sockets needs a higher number: how many people you expect connected at once per replica, from 1 to 1000. A new app with a socket library in its package.json starts with 250. See WebSocket and Socket.IO.

Whether an idle app sleeps, and after how long, is set here too, with Keep one replica always on and Sleep after. See Sleep and wake.

The region is where your app runs. You choose it when you create the app, from regions in North and South America, Europe, Africa, Asia and Oceania. Pick the one closest to your visitors, or to your database.

Compute prices differ between regions. The price beside each region is the most one replica of your size costs there in a month.

Pick another region under Settings, Scaling, save, and deploy again. The deployment starts replicas in the new region and checks them before the old ones are removed, so the app stays online during the move. If the move fails, the app stays where it was.

Running time is charged at the new region’s price once the app has moved.

Overview shows what each replica is doing right now, and CPU, memory, requests and response time for the last 24 hours.