Scale applications

After you deploy an application, you can scale the application by updating its runtime to change the number of application instances and edit the CPU and memory configuration.

Note

The tanzu app scale command includes an interactive mode. When you run tanzu app scale <APP-NAME>, the command prompts you to provide new values for each of the application instance count, CPU, and memory.

The CPU and memory values that you provide are applied to all application instances. For example, if you configure 3 instances with 300M CPU and 1Gi memory each, this consumes 900M CPU and 3Gi memory in total. Only resources for which you provide a value are updated.

Update the application instance count

You can scale an application by updating the number of application instances per Space replica. A Space replica is an availability target for an application.

UI-based steps
Do the following in Tanzu Platform hub:
  1. Set the project context to your project.
  2. On the left navigation pane, expand Application Spaces.
  3. Click Spaces and select your Space.
  4. Select the Applications tab and click on your application.
  5. Click the Scale button.
  6. In the window that opens, update Application instances to specify the number of application instances per space replica. Leaving the field empty removes the configuration from the underlying resource.
  7. Click Save.
Tanzu CLI-based steps
Use Tanzu CLI commands to update the number of application instances.
  1. Use the Tanzu CLI to ensure that your project context is set correctly.

    tanzu project use PROJECT-NAME
    
  2. To update the number of application instances per Space replica, run the tanzu app scale command with the --instances option.

    tanzu app scale <APP-NAME> --instances=10
    

    In the example above, <APP-NAME> is the ContainerApp name of your application.

  3. To delete the application instance count configuration without specifying a number of instances, run:

    tanzu app scale <APP-NAME> --instances-
    

    This command keeps the current number of replicas running unless the currently enforced number of instances is 0. If the enforced number of instances is 0, the default number of replicas is started instead. This number is most likely 1 unless the app was custom built with other default values.

Update application CPU and memory

You can scale an application by updating the application CPU and memory configuration for all application instances in each Space replica.

UI-based steps
Do the following in Tanzu Platform hub:
  1. Set the project context to your project.
  2. On the left navigation pane, expand Application Spaces.
  3. Click Spaces and select your Space.
  4. Select the Applications tab and click on your application.
  5. Scroll to Requested Resources and click the Edit button.
  6. In the window that opens, update the CPU and Memory resources. Leaving the fields empty removes the configuration from the underlying resource.
  7. Click Save.
Tanzu CLI-based steps
Use Tanzu CLI commands to update the application CPU configuration in each Space replica.
  1. Use the Tanzu CLI to ensure that your project context is set correctly.

    tanzu project use PROJECT-NAME
    
  2. To update the application CPU configuration in each Space replica, run the tanzu app scale command with the --cpu option.

    You can provide either a number of cores, for example --cpu=10, or a number of millicores, for example 500m.

    tanzu app scale <APP-NAME> --cpu=10
    

    In the example above, <APP-NAME> is the ContainerApp name of your application.

  3. To delete the application CPU configuration, run the tanzu app scale command without specifying a number of CPUs.

    tanzu app scale <APP-NAME> --cpu-
    
  4. To update the application memory configuration in each Space replica, run the tanzu app scale command with the --memory option.

    By default memory configuration is in bytes, but you can also use any of the quantity suffixes described in Memory resource units in the Kubernetes documentation.

    tanzu app scale <APP-NAME> --memory=500M
    
  5. To delete the application memory configuration, run the tanzu app scale command without specifying a quantity of memory.

    tanzu app scale <APP-NAME> --memory-
    
check-circle-line exclamation-circle-line close-line
Scroll to top icon