Scale a service
Change a service's size, run more replicas, and choose how requests reach them.
All pages
- 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:
Terminalghaym cloud services set web instanceSizeSlug=<size> - 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:
Terminalghaym cloud services scale web --replicas 3 - Press ⌘K, choose Review changes, then press ⌘↵ to apply it.
Size and replicas apply without a new deploy.
With the CLI:
Terminalghaym cloud changes apply --project shop
Routing decides which replica answers a request.
| Routing | What it does |
|---|---|
| Evenly | Sends each request to the next replica in turn. Pick it when the app keeps nothing about a visitor in memory. |
| Each visitor to their replica | Sticky 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 --applyA 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>