Setting Autoscaling Parameters with the API Explorer

If you use the gcloud CLI tooling to deploy your app, such as gcloud app deploy, you can set the following autoscaling parameters in the app.yaml configuration file:

  • min_instances
  • max_instances
  • target_throughput_utilization
  • target_cpu_utilization

You can also use the API explorer user interface to set an autoscaling parameter:

  1. Open the API explorer page.

  2. In the right panel under the label Try This API, locate the name text box and enter the application name string in the following format:

       apps/<YOUR-PROJECT-ID>/services/default/versions/<YOUR-VERSION-ID>
    

    Replace YOUR-PROJECT-ID with your application's project ID, and <YOUR-VERSION-ID> with the version of the app you are sending the request to. Use the rest of the string as shown.

  3. In the updateMask text box, enter the full .json object path name of the parameter you are setting, using updateMask names from the table below:

    updateMask name
    automatic_scaling.standard_scheduler_settings.max_instances
    automatic_scaling.standard_scheduler_settings.min_instances
    automatic_scaling.standard_scheduler_settings.target_cpu_utilization
    automatic_scaling.standard_scheduler_settings.target_throughput_utilization

    If you are setting more than one parameter in one request, supply the mask name for each parameter, separated by a comma. For example, if you are setting the min and max instances, and the CPU utilization, use the following updateMask:

        automatic_scaling.standard_scheduler_settings.max_instances,
        automatic_scaling.standard_scheduler_settings.min_instances,
        automatic_scaling.standard_scheduler_settings.target_cpu_utilization
    
  4. In the Request body box, click Add request body parameters .

  5. Select automaticScaling.

  6. Click the hint bubble (the + icon), then select standardSchedulerSettings.

  7. Click the hint bubble, then select the desired auto scaling scheduler parameter and supply the desired value.

  8. To supply another auto scaling scheduler parameter, click the hint bubble again, select the parameter, and supply its value.

    The following example shows a sample filled out request body:

       {
         "automaticScaling": {
            "standardSchedulerSettings": {
              "maxInstances": 100,
              "minInstances": 1,
              "targetCpuUtilization": 0.75
            }
         }
       }
    
  9. Click Execute. You may be prompted to authorize API Explorer the first time you run this. If you are prompted, authorize API Explorer by following the prompts.

  10. Confirm that the correct settings have been applied by opening the App Engine versions page for your project, and clicking View in the Config column. You should see the values you just set.