Autoscaling-Parameter mit dem API Explorer festlegen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wenn Sie gcloud CLI-Tools zum Bereitstellen Ihrer Anwendung verwenden (wie z. B. gcloud app deploy
), können Sie folgende Autoscaling-Parameter in der app.yaml
-Konfigurationsdatei festlegen:
min_instances
max_instances
target_throughput_utilization
target_cpu_utilization
Sie können auch die API Explorer-Benutzeroberfläche verwenden, um einen Autoscaling-Parameter festzulegen:
Öffnen Sie die API Explorer-Seite.
Suchen Sie im rechten Bereich unter Try this API (API testen) nach dem Textfeld name und geben Sie den Namen der Anwendung als String im folgenden Format ein:
apps/<YOUR-PROJECT-ID>/services/default/versions/<YOUR-VERSION-ID>
Ersetzen Sie YOUR-PROJECT-ID
durch die Projekt-ID Ihrer Anwendung und <YOUR-VERSION-ID>
durch die Version der Anwendung, an die Sie die Anfrage senden. Verwenden Sie den Rest des Strings wie gezeigt.
Geben Sie in das Textfeld updateMask den vollständigen .json
-Objektpfadnamen des von Ihnen festgelegten Parameters ein. Verwenden Sie dazu die updateMask
-Namen aus der folgenden Tabelle:
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 |
Wenn Sie mehr als einen Parameter in einer Anfrage festlegen, geben Sie die Maskennamen der einzelnen Parameter durch Kommas getrennt an. Wenn Sie zum Beispiel die Mindest- und Höchstzahl von Instanzen und die CPU-Auslastung festlegen, verwenden Sie die folgende updateMask:
automatic_scaling.standard_scheduler_settings.max_instances,
automatic_scaling.standard_scheduler_settings.min_instances,
automatic_scaling.standard_scheduler_settings.target_cpu_utilization
Klicken Sie im Feld Request body (Anfragetext) auf Add request body parameters (Anfragetextparameter hinzufügen).
Wählen Sie automaticScaling aus.
Klicken Sie auf das Infofeld (+
) und wählen Sie standardSchedulerSettings aus.
Klicken Sie auf das Infofeld, wählen Sie den gewünschten Autoscaling-Scheduler-Parameter aus und geben Sie den entsprechenden Wert ein.
Wenn Sie einen weiteren Autoscaling-Planer-Parameter angeben möchten, klicken Sie noch einmal auf das Infofeld, wählen den Parameter aus und geben dessen Wert ein.
Im folgenden Beispiel wird ein ausgefüllter Anfragetext gezeigt:
{
"automaticScaling": {
"standardSchedulerSettings": {
"maxInstances": 100,
"minInstances": 1,
"targetCpuUtilization": 0.75
}
}
}
Klicken Sie auf Ausführen. Sie werden bei der ersten Ausführung möglicherweise aufgefordert, den API Explorer zu autorisieren. Wenn dies der Fall ist, folgen Sie den Aufforderungen zum Autorisieren des API Explorers.
Prüfen Sie, ob die richtigen Einstellungen angewendet wurden. Öffnen Sie dazu die Seite "App Engine-Versionen" für Ihr Projekt und klicken Sie in der Spalte Config (Konfiguration) auf View (Anzeigen). Es sollten die Werte angezeigt werden, die Sie gerade festgelegt haben.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-09-04 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eYou can configure autoscaling parameters for your application using the \u003ccode\u003egcloud app deploy\u003c/code\u003e command and specifying values in the \u003ccode\u003eapp.yaml\u003c/code\u003e file for \u003ccode\u003emin_instances\u003c/code\u003e, \u003ccode\u003emax_instances\u003c/code\u003e, \u003ccode\u003etarget_throughput_utilization\u003c/code\u003e, and \u003ccode\u003etarget_cpu_utilization\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe API explorer user interface allows for the configuration of autoscaling parameters by specifying the \u003ccode\u003eupdateMask\u003c/code\u003e names such as \u003ccode\u003eautomatic_scaling.standard_scheduler_settings.max_instances\u003c/code\u003e and corresponding values in the request body.\u003c/p\u003e\n"],["\u003cp\u003eTo update multiple parameters using the API explorer, you must include each parameter's \u003ccode\u003eupdateMask\u003c/code\u003e name separated by commas within the \u003ccode\u003eupdateMask\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eAfter setting your parameters through the API explorer, you can confirm the new values have been correctly applied by viewing the \u003cem\u003eConfig\u003c/em\u003e column on the App Engine versions page for your project.\u003c/p\u003e\n"]]],[],null,["# Setting Autoscaling Parameters with the API Explorer\n\nIf you use the gcloud CLI tooling to deploy your app, such as\n`gcloud app deploy`,\n\nyou can set the following autoscaling parameters in the\n`app.yaml` configuration file:\n\n- `min_instances`\n- `max_instances`\n- `target_throughput_utilization`\n- `target_cpu_utilization`\n\nYou can also use the API explorer user interface to set an [autoscaling parameter](/appengine/docs/legacy/standard/python/config/appref#scaling_elements):\n\n1. Open the [API explorer\n page](/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch).\n\n2. In the right panel under the label *Try This API* , locate the **name**\n text box and enter the application name string in the following format:\n\n apps/\u003cYOUR-PROJECT-ID\u003e/services/default/versions/\u003cYOUR-VERSION-ID\u003e\n\n Replace `YOUR-PROJECT-ID` with your application's project ID, and\n `\u003cYOUR-VERSION-ID\u003e` with the version of the app you are sending the request\n to. Use the rest of the string as shown.\n3. In the **updateMask** text box, enter the full `.json` object path name of the\n parameter you are setting, using `updateMask` names from the table below:\n\n If you are setting more than one parameter in one request, supply the mask\n name for each parameter, separated by a comma. For example, if you are\n setting the min and max instances, and the CPU utilization, use the\n following updateMask: \n\n automatic_scaling.standard_scheduler_settings.max_instances,\n automatic_scaling.standard_scheduler_settings.min_instances,\n automatic_scaling.standard_scheduler_settings.target_cpu_utilization\n\n4. In the **Request body** box, click **Add request body parameters** .\n\n5. Select **automaticScaling**.\n\n6. Click the hint bubble (the `+` icon), then select **standardSchedulerSettings**.\n\n7. Click the hint bubble, then select the desired auto scaling scheduler\n parameter and supply the desired value.\n\n8. To supply another auto scaling scheduler parameter, click the hint bubble\n again, select the parameter, and supply its value.\n\n The following example shows a sample filled out request body: \n\n {\n \"automaticScaling\": {\n \"standardSchedulerSettings\": {\n \"maxInstances\": 100,\n \"minInstances\": 1,\n \"targetCpuUtilization\": 0.75\n }\n }\n }\n\n9. Click **Execute**. You may be prompted to authorize API Explorer the first\n time you run this. If you are prompted, authorize API Explorer by following the\n prompts.\n\n10. Confirm that the correct settings have been applied by opening the\n [App Engine\n versions page](https://console.cloud.google.com/appengine/versions) for your project, and clicking **View** in the\n *Config* column. You should see the values you just set."]]