Skip to main content

Replicas and load balancing

A scale group is several copies of the same lab — replicas — serving one domain. Every request to that domain is handed to the next replica in turn (round-robin), so the load is spread and one replica going down does not take the site with it.

By the end of this page you will have a group running and know which options to turn on for your kind of app.

When to use one

Use a scale group whenUse a single lab or an extra copy when
A public web app needs to handle more traffic than one lab canYou are developing, or only you use it
You want the site to stay up while one replica restartsThe app keeps its state in memory or local files and cannot be split
You want to try a new version on a slice of real traffic firstYou want separate machines for separate projects
What you need first
  • A lab whose template allows copies. The Scale button is on the lab's Deployments tab only when it does.
  • At least one domain. The group is reached through it.
  • An app that listens on a port inside the lab.

1. Open the wizard

Open the lab, go to Deployments and click Scale. The wizard has six steps; Next checks each one before moving on.

The Scale wizard on step 4, with Fixed count / Autoscale toggle, Min and Max replicas and the CPU signal visible, plus the step dots at the top.

2. Name the group and point at your app

FieldWhat to enter
Scale groupA name for the group — lowercase letters, digits and dashes, up to 32 characters
App portThe port your app listens on inside the lab, for example 8080

3. Choose what replicas see

OptionWhat it means
Shared account home (default)Replicas see the same files as all your other labs. Edits show up everywhere.
Isolated group storageOne private home shared by this group only. It lasts until the last replica is removed.

With isolated storage you choose how it starts: Fresh empty home or Clone my home. Cloning is cheap where your storage supports it, and greyed out where it does not — the same rule as for extra copies.

Replicas share one home either way

Every replica in a group reads and writes the same files. That is right for stateless or read-mostly apps. If your app writes files that another replica might overwrite, keep that data in a database instead.

4. Decide how many replicas

Fixed count runs exactly the number you choose, from 2 to 16.

Autoscale adds and removes replicas for you:

SettingMeaning
Min replicas / Max replicasThe range the group stays within, up to 16
CPUAdd replicas when the group is busier than this percentage
MemoryAdd replicas above this percentage

Pick at least one of CPU or memory. The step also tells you how many replicas of this size your plan can afford.

Autoscaling needs a paid plan

If your plan's compute budget is zero, the Autoscale option is disabled and you can only run a fixed count.

How autoscaling behaves:

  • It checks the group about once a minute.
  • It grows a few replicas at a time and shrinks one at a time, so traffic does not swing wildly.
  • The memory signal only ever adds replicas; it never removes them.
  • Every replica still counts against your copy limit, so the group cannot grow past it whatever Max replicas says.

5. Traffic and safety

OptionWhat it doesTurn it on when
Domains for this groupThe shared URL. Pick at least one.Always
Sticky sessions (on by default)Keeps each visitor on the same replicaYour app has logins or sessions held in memory
Compress responses (gzip/br)Compresses pages on the way outText-heavy sites
Health-check pathA path such as /health that must answer successfully; replicas that fail it are taken out of rotation until they recoverAlways with autoscale, and recommended otherwise
Restrict to IPs / CIDRsOnly these addresses can reach the site, comma-separated, e.g. 203.0.113.0/24Staging sites, internal tools
Basic-auth user / passwordVisitors must enter this user name and passwordA quick lock on a preview site

6. Review and create

Check the summary and click Create scale group. The starting replicas are deployed one after another — for autoscale, that is the Min replicas number — and the policy is saved. You land on the lab's Deployments tab with the new group card.

The group card

Groups appear on the lab's Deployments tab and under Instances → My Instances → Scale groups.

On the cardMeaning
Scale group: nameThe group
X/Y runningReplicas up, out of the replicas in the group
Domain badgesThe shared URL — click to open it
auto 2–4 · cpu 70%Autoscaling on, with its range and signal
fixed 3A fixed count, autoscaling off

The card also lists the group's last few scaling events, and has three buttons:

ButtonUse it to
ScalingChange the policy — fixed or autoscale, the range and the signals
CanaryTry a new version on part of the traffic (below)
Add replicaAdd one or more replicas to the group by hand

Each replica is an ordinary lab copy underneath, with its own row, dashboard and Activity tab.

Canary releases

A canary is one extra replica on the same URL that takes a controlled share of traffic, so you can try a change before every visitor sees it.

Click Canary on the group card and choose a mode:

ModeWhat happens
WeightedA percentage of real traffic (1–99%, set with the slider) goes to the canary
MirrorThe canary receives a copy of all traffic, but its responses are thrown away — visitors are never affected

Click Deploy canary. To go back to 100% on the main replicas, stop the canary.

Mirror first, then weight

Mirror mode is the safe way to see whether a new version crashes under real requests. Once it holds up, redeploy it as a weighted canary at a small percentage.

Limits

LimitValue
Replicas per group2 to 16 at creation; up to 16 with autoscale
Copy limitEvery replica counts, running or stopped — see Running extra labs
AutoscalePaid plans only
DomainsAt least one per group

Pausing a replica

Pause keeps a replica in the pool

If the group has no health check, a paused replica stays in rotation and its share of requests hangs. The dashboard warns you before pausing it. Add a health-check path, or stop the replica instead of pausing it.

Do it with an AI assistant

Scale groups are set up in the dashboard only; an assistant connected over MCP cannot create or change one. It can list the replicas with list_labs and check each one with lab_status and lab_stats.

Next