milvus2.1ベンチマーククイック・ガイド
カバー
最近、Milvus 2.1のベンチマークレポートを更新した。100万ベクトルからなるデータセットを用いたテストにより、small-nqクエリをマージすることでQPSが劇的に向上することが証明されました。
このテストを簡単に再現するための簡単なスクリプトを紹介します。
手順
Milvusスタンドアロンまたはクラスタをデプロイする。この場合、MilvusサーバのIPアドレスは10.100.31.105である。
クライアントをデプロイする。今回はUbuntu 18.04とPython 3.8.13を使用します。以下のコードを実行して、PyMilvus 2.1.1をインストールします。
pip install pymilvus==2.1.1
以下のファイルをダウンロードして、クライアントと同じ作業ディレクトリにコピーします。この場合、作業ディレクトリは
/go_ben
.benchmark
(Ubuntuの場合)またはbenchmark-mac
(macOSの場合)
です:
benchmark
および は、Go SDK 2.1.1を使用して開発およびコンパイルされた実行可能ファイルです。これらは同時検索を行うためにのみ使用されます。benchmark-mac
Ubuntuユーザーの方は、
benchmark
をダウンロードしてください。macOSユーザーの方は、benchmark-mac
をダウンロードしてください。benchmark
またはbenchmark-mac
にアクセスするには、実行可能パーミッションが必要です。Macユーザーは、システム環境設定の「セキュリティとプライバシー」を設定して、
benchmark-mac
ファイルを信頼する必要があります。同時検索に関する設定は、
go_benchmark.py
のソースコードで確認および変更できます。
- コレクションを作成し、ベクトルデータを挿入する。
root@milvus-pytest:/go_ben# python collection_prepare.py 10.100.31.105
/tmp/collection_prepare.log
を開いて実行結果をチェックする。
...
08/11/2022 17:33:34 PM - INFO - Build index costs 263.626
08/11/2022 17:33:54 PM - INFO - Collection prepared completed
benchmark
(macOS ではbenchmark-mac
) を呼 び 出 して、同時検索を実行する。
root@milvus-pytest:/go_ben# python go_benchmark.py 10.100.31.105 ./benchmark
[write_json_file] Remove file(search_vector_file.json).
[write_json_file] Write json file:search_vector_file.json done.
Params of go_benchmark: ['./benchmark', 'locust', '-u', '10.100.31.105:19530', '-q', 'search_vector_file.json', '-s', '{\n "collection_name": "random_1m",\n "partition_names": [],\n "fieldName": "embedding",\n "index_type": "HNSW",\n "metric_type": "L2",\n "params": {\n "sp_value": 64,\n "dim": 128\n },\n "limit": 1,\n "expr": null,\n "output_fields": [],\n "timeout": 600\n}', '-p', '10', '-f', 'json', '-t', '60', '-i', '20', '-l', 'go_log_file.log']
[2022-08-11 11:37:39.811][ INFO] - Name # reqs # fails | Avg Min Max Median | req/s failures/s (benchmark_run.go:212:sample)
[2022-08-11 11:37:39.811][ INFO] - go search 9665 0(0.00%) | 20.679 6.499 81.761 12.810 | 483.25 0.00 (benchmark_run.go:213:sample)
[2022-08-11 11:37:59.811][ INFO] - Name # reqs # fails | Avg Min Max Median | req/s failures/s (benchmark_run.go:212:sample)
[2022-08-11 11:37:59.811][ INFO] - go search 19448 0(0.00%) | 20.443 6.549 78.121 13.401 | 489.22 0.00 (benchmark_run.go:213:sample)
[2022-08-11 11:38:19.811][ INFO] - Name # reqs # fails | Avg Min Max Median | req/s failures/s (benchmark_run.go:212:sample)
[2022-08-11 11:38:19.811][ INFO] - go search 29170 0(0.00%) | 20.568 6.398 76.887 12.828 | 486.15 0.00 (benchmark_run.go:213:sample)
[2022-08-11 11:38:19.811][ DEBUG] - go search run finished, parallel: 10(benchmark_run.go:95:benchmark)
[2022-08-11 11:38:19.811][ INFO] - Name # reqs # fails | Avg Min Max Median | req/s failures/s (benchmark_run.go:159:samplingLoop)
[2022-08-11 11:38:19.811][ INFO] - go search 29180 0(0.00%) | 20.560 6.398 81.761 13.014 | 486.25 0.00 (benchmark_run.go:160:samplingLoop)
Result of go_benchmark: {'response': True, 'err_code': 0, 'err_message': ''}
- カレントディレクトリの下にある
go_log_file.log
ファイルを開いて、詳細な検索ログを確認する。検索ログに記載されている検索情報は以下の通りです。reqs: 同時検索が発生した時点から現在までの検索リクエスト数(現在のタイムスパン)
fails: 現在のタイムスパンにおける reqs に占める失敗したリクエストの数
Avg: 現在のタイムスパンにおける平均リクエスト応答時間(単位:ミリ秒)
Min: 現在のタイムスパンにおける最小リクエスト・レスポンス・タイム (単位: ミリ秒)
Max: 現在のタイムスパンにおけるリクエスト・レスポンス・タイムの最大値 (単位: ミリ秒)
Median: 現在のタイムスパンにおけるリクエスト応答時間の中央値 (単位: ミリ秒)
req/s:1秒あたりのリクエスト数、つまりQPS
failures/s: 現在のタイムスパンにおける1秒あたりの平均失敗リクエスト数
スクリプトと実行ファイルのダウンロード
Ubuntu 用benchmark
macOS用benchmark-mac
今後の予定
Milvus 2.1の正式リリースに伴い、新機能を紹介する一連のブログを用意しました。このブログシリーズの続きを読む
- 手順
- スクリプトと実行ファイルのダウンロード
- 今後の予定
On This Page
Try Managed Milvus for Free
Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.
Get StartedLike the article? Spread the word