Scale an app
Change how many machines run an app, where they run, and their size.
Every machine runs the same container. One machine in one location is reached directly: the app's names point at the machine, which gets its own certificates. More machines, or more than one location, put the app behind a load balancer of its own: the app's names point at the balancer, which ends TLS with a certificate the platform issues and renews, and spreads requests over the machines. Replace app-id with the app's id.
Important
Every machine is a compute instance, billed as one. Adding machines adds to what you pay.
Prerequisites
- Permission for
deploy:UpdateAppon the app. - In the console, also
deploy:DescribeAppto open the app's page (without it the page is not found).
Change the scale
- Open the app's Runtime tab.
- Under Scaling, for Machines, enter a number from 1 to 10.
- Under Locations, select the locations the machines are spread over, in the order you want them used. None selected means the region's default location.
- Choose Save. The panel says Saved. Deploy to apply, and whether the app is Behind a load balancer or Reached directly.
- Choose Deploy at the top of the page.
The machine size is changed with the CLI, the API or Terraform.
dcloud deploy apps update app-id --replicas 3 \
--locations fsn1 --locations nbg1 --instance-type performance-4PATCH /deploy/api/apps/3f1c2b4a-5d6e-4f70-8a91-b2c3d4e5f601
{ "replicas": 3, "locations": ["fsn1", "nbg1"], "instanceType": "performance-4" }resource "dcloud_app" "web" {
name = "my-app"
builder = "image"
image_ref = "org-example1234.ecr.example.com/orders:1.4.2"
replicas = 3
locations = ["fsn1", "nbg1"]
instance_type = "performance-4"
}Locations are fsn1 (Falkenstein) and nbg1 (Nuremberg), at most three, each listed once; or
hel1 (Helsinki, Finland) alone, only when the organization allows EU locations outside Germany
(Settings → Data location). Locations of different regions are never mixed; anything else is
refused with 400, for example "All locations of an app must be in one region: Germany (fsn1,
nbg1) or Finland (hel1), not both". More than 10 machines is refused with 400 too. An app that is
being deleted answers 409 "The app is being deleted".
Result
From the next deployment the app runs on the given number of machines, spread over the locations in the order given. Scaling down removes the newest machines once the rest serve the new version. The machines appear under Compute as well. A wildcard domain behind a load balancer is covered only when its zone is in Deutsche Cloud DNS.