# 自動スケーリング

## 手順

{% stepper %}
{% step %}

### App Service プランの Autoscale 設定に移動します

Azure Portal > App Service プラン > *SCEPman の App Service プラン* > 設定 > スケールアウト

<figure><img src="/files/cef4f383bc6779a3e3616a0936bb0bd6304ac42e" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
App Service プランでは、少なくとも **S1 または P0V3** の価格レベルを使用していることを確認してください。下位のプランでは複数のインスタンスを提供できない場合があります。
{% endhint %}
{% endstep %}

{% step %}

### ルールベースの自動スケーリングを選択します

を選択します **ルールベース**、その後 **Configure** に進みます。

<figure><img src="/files/453cb9dbc8af13bda7ba342a91826a93b9c19c83" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Autoscale 設定を構成する

サービスの現在の負荷に基づいてインスタンス数をスケールするには、2 つのスケーリング ルール条件を追加する必要があります。1 つは高負荷時にインスタンス数を増やすルール、もう 1 つは負荷が再び減少した後にインスタンス数を減らすルールです。

<figure><img src="/files/f2fd4e8a9182cc019950959f2f5c600bd7990ff3" alt=""><figcaption></figcaption></figure>

1. を選択します **カスタム自動スケール**
2. 適切な名前を次に入力します **Autoscale 設定名**
3. を選択します **メトリックに基づいてスケールする** 定義されたルール セットに基づく自動スケーリングを有効にするには
4. ビジネス要件に合わせてインスタンスの制限を設定します:
   * 最小
   * 最大
   * 既定
5. を選択します **ルールの追加** 自動スケーリング ルールの構成の準備ができたら
   {% endstep %}

{% step %}

### 自動スケーリング ルールを構成する

{% hint style="info" %}
増加ルールと減少ルールについては、以下の設定を推奨します。\
ただし、これはワークロードに依存し、監視と最適化が必要であることにご留意ください。
{% endhint %}

#### インスタンス数増加ルール

1. **メトリックをインスタンス数で割るを有効にする**
2. 選択 **より大きい** を演算子として選択し、しきい値を **70** (パーセント)
3. 期間を **10** (分)
4. 次を確認します **時間粒度の統計** が **平均**
5. 次を確認します **操作** が **増加数**
6. 設定してください **クールダウン (分)** から **15** (分)
7. 次を確認します **インスタンス数 (1)** 現在のインスタンスに追加される
8. をクリックする **追加** 完了したら

<figure><img src="/files/1889fae451fbaea020dc1c30847943d4b29c349c" alt=""><figcaption></figcaption></figure>

#### インスタンス数減少ルール

1. を選択します **ルールの追加** 追加のルールを追加する
2. **メトリックをインスタンス数で割るを有効にする**
3. 選択 **未満** を演算子として選択し、しきい値を **35** (パーセント)
4. 期間を **20** (分)
5. 次を確認します **時間粒度の統計** が **平均**
6. 次を確認します **操作** が **減少数**
7. 設定してください **クールダウン (分)** から **30** (分)
8. 次を確認します **インスタンス数 (1)** 現在のインスタンスから削除される
9. をクリックする **追加** 完了したら

<figure><img src="/files/3ea819cf80673fa2281830f52e282f0ab01bcdec" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Autoscale 設定を保存

おめでとうございます！これで App Service プランは、ルールに従って自動的にスケールアップおよびスケールダウンします。

<figure><img src="/files/1298512ec1573d816bc6d905406cd41c63306a0f" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scepman.com/ja/azure-gou-cheng/azure-sizing/autoscaling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
