> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deployment/ja/self-hosted/enterprise/parallel-http-api.md).

# 並列 HTTP API

Roboflow Inference の並列 HTTP サーバーを実行して、推論リクエストを非同期に処理し、スループットを向上させレイテンシを低減します。

{% hint style="warning" %}
**エンタープライズ向け機能。** この機能は、Roboflow Enterprise ユーザーのみご利用いただけます。 [営業チームにお問い合わせください](https://roboflow.com/sales) 。Roboflow Enterprise の詳細をご案内します。
{% endhint %}

非同期で推論リクエストを処理する Roboflow Inference のバージョンである並列処理を使用すると、複数のモデルを並列に実行できます。

Inference Parallel は、コアモデル（CLIP と SAM）をサポートしない点を除き、Roboflow Inference と同じ機能をサポートしています。

Inference Parallel では、サーバーの FPS スループットを高めるため、前処理、自動バッチ処理、推論、後処理がそれぞれ別のスレッドで実行されます。同じモデルへの個別のリクエストは、 `$MAX_BATCH_SIZE`で許可される範囲でその場でバッチ処理され、その後、レスポンスは個別に処理されます。画像はスループットを最大化するため、Python の `SharedMemory` モジュール経由で渡されます。

これらの変更により、測定対象のワークロードの1つで、最大 **76%の高速化** を実現しました。

## 並列処理を使用して Inference を実行する方法

{% tabs %}
{% tab title="Bash" %}
まず、並列サーバーをビルドします。

```bash
./inference/enterprise/parallel/build.sh
```

次に、サーバーを実行します。

```bash
./inference/enterprise/parallel/run.sh
```

サーバーが起動し、使用可能な状態であることを示すメッセージがターミナルに表示されます。
{% endtab %}

{% tab title="Docker" %}
コンテナは Docker Hub で公開されています。

```bash
docker pull roboflow/roboflow-inference-server-gpu-parallel:latest
```

固定タグを取得する場合は、 `$TAG` 変数を `run.sh` 内で該当するタグに変更してください。
{% endtab %}
{% endtabs %}

## ベンチマーク

さまざまなモデルを使用して Inference Parallel のパフォーマンスを評価し、同じハードウェア（8コアと GPU 1基を搭載したコンピューター）で Inference Server 0.9.5.rc と比較しました。モデルは [Roboflow Universe](https://universe.roboflow.com/)から選びました。インスタンスセグメンテーションの指標は、リクエスト本文で `"mask_decode_mode": "fast"` を指定して算出しました。リクエストは並列度1000で同時に送信しました。

| ワークスペース                     | モデル                        | モデルタイプ           | 分割    | 0.9.5.rc FPS | 0.9.5.parallel FPS |
| --------------------------- | -------------------------- | ---------------- | ----- | ------------ | ------------------ |
| senior-design-project-j9gpp | nbafootage/3               | object-detection | train | 30.2 fps     | 44.03 fps          |
| niklas-bommersbach-jyjff    | dart-scorer/8              | object-detection | train | 26.6 fps     | 47.0 fps           |
| geonu                       | water-08xpr/1              | インスタンスセグメンテーション  | 有効    | 4.7 fps      | 6.1 fps            |
| university-of-bradford      | detecting-drusen\_1/2      | インスタンスセグメンテーション  | train | 6.2 fps      | 7.2 fps            |
| fy-project-y9ecd            | cataract-detection-viwsu/2 | 分類               | train | 48.5 fps     | 65.4 fps           |
| hesunyu                     | playing-cards-ir0wr/1      | 分類               | train | 44.6 fps     | 57.7 fps           |

すべてのテストで、並列処理を有効にした推論はFPSが向上しました。一部のモデルでは、FPSの増加幅が10 FPSを超えました。
