Scale a service

Change a service's size, run more replicas, and choose how requests reach them.

Change the size or the replicas

  1. Open the service, press ⌘K and choose Settings › Size, then pick a size.

    Each size has its own price. Each environment has its own size, and a change in one never reaches another. The change waits as a staged change.

    With the CLI:

    Terminal
    ghaym cloud services set web instanceSizeSlug=<size>
  2. To run more copies of the service, choose Settings › Replicas and pick a number.

    Your plan sets the most you can run.

    With the CLI:

    Terminal
    ghaym cloud services scale web --replicas 3
  3. Press ⌘K, choose Review changes, then press ⌘↵ to apply it.

    Size and replicas apply without a new deploy.

    With the CLI:

    Terminal
    ghaym cloud changes apply --project shop

Choose how requests reach the replicas

Routing decides which replica answers a request.

RoutingWhat it does
EvenlySends each request to the next replica in turn. Pick it when the app keeps nothing about a visitor in memory.
Each visitor to their replicaSticky sessions. A cookie named ghaym_replica keeps each visitor on the replica that first answered them. Pick it when the app keeps sessions in memory.

Press ⌘K, choose Settings › Routing, and pick one. Then apply the change.

Terminal
ghaym cloud services scale web --routing same_visitor --apply

A database or a cache adds readers instead of replicas. Its size changes the same way, in each environment, but only to a size with the same disk: a new size changes its memory and its price.

With the CLI:

Terminal
ghaym cloud services set db databaseSizeSlug=<size>