Python 2.7 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Python 2.7 アプリケーションをデプロイできなくなります。既存の Python 2.7 アプリケーションは、
非推奨日以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Python に移行することをおすすめします。
API Explorer による自動スケーリング パラメータの設定
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
たとえば「gcloud app deploy
」など、gcloud CLI ツールを使用してアプリをデプロイする場合は、app.yaml
構成ファイルで次の自動スケーリング パラメータを設定できます。
min_instances
max_instances
target_throughput_utilization
target_cpu_utilization
自動スケーリング パラメータは、API Explorer のユーザー インターフェースを使用して設定することもできます。
[API Explorer] ページを開きます。
右パネルの [この API を試す] というラベルの下にある [名前] テキスト ボックスに、アプリケーション名の文字列を次の形式で入力します。
apps/<YOUR-PROJECT-ID>/services/default/versions/<YOUR-VERSION-ID>
YOUR-PROJECT-ID
をアプリケーションのプロジェクト ID に、<YOUR-VERSION-ID>
をリクエストの送信先アプリのバージョンにそれぞれ置き換えます。文字列のその他の部分はそのまま使用します。
[updateMask] テキスト ボックスに、以下の表の updateMask
名を使用して、設定するパラメータの完全な .json
オブジェクト パス名を入力します。
updateMask 名 |
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 |
1 つのリクエストで複数のパラメータを設定する場合は、各パラメータのマスク名をカンマで区切って指定します。たとえば、最小インスタンス数、最大インスタンス数、CPU 使用率を設定する場合は、次の updateMask を使用します。
automatic_scaling.standard_scheduler_settings.max_instances,
automatic_scaling.standard_scheduler_settings.min_instances,
automatic_scaling.standard_scheduler_settings.target_cpu_utilization
[Request body] ボックスで、[Add request body parameters] をクリックします。
[automaticScaling] を選択します。
ヒントのふきだし(+
アイコン)をクリックして、[standardSchedulerSettings] を選択します。
ヒントのふきだしをクリックして、目的の自動スケーリング スケジューラ パラメータを選択し、目的の値を入力します。
追加の自動スケーリング スケジューラ パラメータを入力するには、再度ヒントの吹き出しをクリックし、パラメータを選択して値を入力します。
次の例は、リクエスト本文の入力例を示しています。
{
"automaticScaling": {
"standardSchedulerSettings": {
"maxInstances": 100,
"minInstances": 1,
"targetCpuUtilization": 0.75
}
}
}
[Execute] をクリックします。初めて実行する際には、API Explorer の承認を求めるプロンプトが表示されることがあります。プロンプトが表示されたら、その指示に従って API Explorer を承認します。
プロジェクトの App Engine の [バージョン] ページを開き、[構成] 列の [表示] をクリックして、正しい設定が適用されていることを確認します。先ほど設定した値が表示されます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 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."]]