You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
19 KiB

# Milvus 2.2 基准测试报告
本报告展示了 Milvus 2.2.0 的主要测试结果,旨在介绍 Milvus 2.2.0 的搜索性能,特别是扩展和缩小的能力。
![Milvus Performance Evaluation 2023](https://zilliz.com/images/whitepaper/performance.png)
我们最近对 Milvus 2.2.3 进行了一次基准测试,主要结果如下:
- 搜索延迟降低 2.5 倍
- QPS 提高 4.5 倍
- 十亿规模的相似性搜索,性能几乎没有下降
- 使用多个副本时的线性可扩展性
有关详细信息,请参阅[本白皮书](https://zilliz.com/resources/whitepaper/milvus-performance-benchmark)和[相关基准测试代码](https://github.com/zilliztech/VectorDBBench)。
## 总结
- 与 Milvus 2.1 相比,Milvus 2.2.0 的 QPS 在集群模式下提高了 48%,在 Standalone 模式下提高了 75%。
- Milvus 2.2.0 的扩展和缩小能力令人印象深刻:
- 当 CPU 内核从 8 个扩展到 32 个时,QPS 呈线性增长。
- 将 Querynode 复制从 1 个扩展到 8 个时,QPS 呈线性增长。
## 术语
<details style="box-sizing: inherit; margin: 8px 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; display: block; line-height: 1.4em; color: rgb(25, 25, 25); font-family: Geist, Inter, &quot;Geist Mono&quot;, SourceCodePro, &quot;serif&quot;; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><summary style="box-sizing: inherit; margin: 0px 0px 8px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; cursor: pointer; color: rgb(25, 25, 25);">点击查看测试中使用的术语详情</summary><table class="terminology" style="box-sizing: inherit; margin: 24px 0px; padding: 0px; border: 1px solid rgb(236, 236, 238); font-size: 16px; vertical-align: baseline; border-collapse: collapse; border-spacing: 0px; overflow-x: auto; width: 886px; border-radius: 12px; display: block; hyphens: none;"><thead style="box-sizing: inherit; margin: 0px; padding: 12px; border-width: 0px 0px 1px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: rgb(238, 238, 238); border-left-color: initial; border-image: initial; font-size: 16px; vertical-align: baseline; line-height: 22px; text-align: left; min-width: 100%; width: calc(-32px + 100vw);"><tr style="box-sizing: inherit; margin: 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline;"><th style="box-sizing: inherit; margin: 0px; padding: 10px 20px; border-width: 0px 1px 0px 0px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: initial; border-top-color: initial; border-right-color: rgb(236, 236, 238); border-bottom-color: initial; border-left-color: initial; border-image: initial; font-size: 16px; vertical-align: baseline; line-height: 1.5; font-weight: 600; text-align: left !important;"></th><th style="box-sizing: inherit; margin: 0px; padding: 10px 20px; border: 0px; font-size: 16px; vertical-align: baseline; line-height: 1.5; font-weight: 600; text-align: left !important;"></th></tr></thead><tbody style="box-sizing: inherit; margin: 0px; padding: 12px; border: 0px; font-size: 14px; vertical-align: baseline; line-height: 1.4em; text-align: left; font-weight: 400;"><tr style="box-sizing: inherit; margin: 0px; padding: 0px; border-width: 0px 0px 1px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: rgb(236, 236, 238); border-left-color: initial; border-image: initial; font-size: 14px; vertical-align: baseline;"><td style="box-sizing: inherit; margin: 0px; padding: 10px 20px; border-width: 0px 1px 0px 0px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: initial; border-top-color: initial; border-right-color: rgb(236, 236, 238); border-bottom-color: initial; border-left-color: initial; border-image: initial; font-size: 14px; vertical-align: text-top; line-height: 1.5; width: calc(-32px + 100vw); font-weight: 500; color: rgb(102, 113, 118); text-align: left !important;"></td><td style="box-sizing: inherit; margin: 0px; padding: 10px 20px; border: 0px; font-size: 14px; vertical-align: text-top; line-height: 1.5; width: calc(-32px + 100vw); font-weight: 500; color: rgb(102, 113, 118); text-align: left !important;"></td></tr><tr style="box-sizing: inherit; margin: 0px; padding: 0px; border-width: 0px 0px 1px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: rgb(
## 测试环境
所有测试均在以下环境下进行。
### 硬件环境
| 硬件环境 | 规格 |
| ---------- | -------------------------------------- |
| 中央处理器 | 英特尔® 至强® Gold 6226R CPU @ 2.90GHz |
| 内存 | 16*/32 GB RDIMM,3200 MT/s |
| 固态硬盘 | SATA 6 Gbps |
### 软件环境
| 软件环境 | 版本 |
| ------------- | ------ |
| Milvus | v2.2.0 |
| Milvus GO SDK | v2.2.0 |
### 部署方案
- Milvus 实例(单机或集群)通过[Helm](https://milvus.io/docs/install_standalone-helm.md)部署在基于物理机或虚拟机的 Kubernetes 集群上。
- 不同的测试仅在 CPU 内核数量、内存大小和副本(工作节点)数量上有所不同,这仅适用于 Milvus 集群。
- 未指定的配置与[默认配置](https://github.com/milvus-io/milvus-helm/blob/master/charts/milvus/values.yaml)相同。
- Milvus 依赖项(MinIO、Pulsar 和 Etcd)将数据存储在每个节点的本地固态硬盘上。
- 搜索请求通过[Milvus GO SDK](https://github.com/milvus-io/milvus-sdk-go/tree/master/tests) 发送到 Milvus 实例。
### 数据集
测试使用[ANN-Benchmarks](https://github.com/erikbern/ann-benchmarks/#data-sets) 的开源数据集 SIFT(128 维)。
## 测试流程
1. 使用 Helm 启动 Milvus 实例,并按照每个测试中列出的各自服务器配置。
2. 通过 Milvus GO SDK 连接到 Milvus 实例并获取相应的测试结果。
3. 创建一个 Collection。
4. 插入 100 万个 SIFT 向量。建立 HNSW 索引并配置索引参数,将`M` 设置为`8` ,将`efConstruction` 设置为`200` 。
5. 加载 Collections。
6. 使用不同的并发数进行搜索,搜索参数为`nq=1, topk=1, ef=64` ,每个并发数的持续时间至少为 1 小时。
## 测试结果
### Milvus 2.2.0 对 Milvus 2.1.0
#### 群集
<details style="box-sizing: inherit; margin: 8px 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; display: block; line-height: 1.4em; color: rgb(25, 25, 25); font-family: Geist, Inter, &quot;Geist Mono&quot;, SourceCodePro, &quot;serif&quot;; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><summary style="box-sizing: inherit; margin: 0px 0px 8px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; cursor: pointer; color: rgb(25, 25, 25);"><b style="box-sizing: inherit; margin: 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline;">服务器配置(群集)</b></summary><code translate="no" style="box-sizing: inherit; margin: 0px; padding: 0px 8px; border: 0px; font-size: 14px; vertical-align: baseline; line-height: 1.4rem; font-family: SourceCodePro; background-color: rgb(208, 215, 220); border-radius: 4px; color: rgb(0, 19, 26); display: inline-block; font-weight: 600;"></code></details>
**搜索性能**
| Milvus | QPS | RT(TP99) / ms | RT(TP50) / ms | 故障/秒 |
| ------ | ----- | ------------- | ------------- | ------- |
| 2.1.0 | 6904 | 59 | 28 | 0 |
| 2.2.0 | 10248 | 63 | 24 | 0 |
![Cluster search performance](https://milvus.io/docs/v2.6.x/assets/cluster_search_performance_210_vs_220.png)群集搜索性能
#### 单机
<details style="box-sizing: inherit; margin: 8px 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; display: block; line-height: 1.4em; color: rgb(25, 25, 25); font-family: Geist, Inter, &quot;Geist Mono&quot;, SourceCodePro, &quot;serif&quot;; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><summary style="box-sizing: inherit; margin: 0px 0px 8px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; cursor: pointer; color: rgb(25, 25, 25);"><b style="box-sizing: inherit; margin: 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline;">服务器配置(单机)</b></summary><code translate="no" style="box-sizing: inherit; margin: 0px; padding: 0px 8px; border: 0px; font-size: 14px; vertical-align: baseline; line-height: 1.4rem; font-family: SourceCodePro; background-color: rgb(208, 215, 220); border-radius: 4px; color: rgb(0, 19, 26); display: inline-block; font-weight: 600;"></code></details>
**搜索性能**
| Milvus | QPS | RT(TP99) / ms | RT(TP50) / ms | 故障/秒 |
| ------ | ---- | ------------- | ------------- | ------- |
| 2.1.0 | 4287 | 104 | 76 | 0 |
| 2.2.0 | 7522 | 127 | 79 | 0 |
![Standalone search performance](https://milvus.io/docs/v2.6.x/assets/standalone_search_performance_210_vs_220.png)独立搜索性能
### Milvus 2.2.0 扩展能力
扩展一个 Querynode 中的 CPU 内核,检查扩展能力。
<details style="box-sizing: inherit; margin: 8px 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; display: block; line-height: 1.4em; color: rgb(25, 25, 25); font-family: Geist, Inter, &quot;Geist Mono&quot;, SourceCodePro, &quot;serif&quot;; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><summary style="box-sizing: inherit; margin: 0px 0px 8px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; cursor: pointer; color: rgb(25, 25, 25);"><b style="box-sizing: inherit; margin: 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline;">服务器配置(群集)</b></summary><code translate="no" style="box-sizing: inherit; margin: 0px; padding: 0px 8px; border: 0px; font-size: 14px; vertical-align: baseline; line-height: 1.4rem; font-family: SourceCodePro; background-color: rgb(208, 215, 220); border-radius: 4px; color: rgb(0, 19, 26); display: inline-block; font-weight: 600;"></code></details>
**搜索性能**
| CPU 内核 | 并发数 | QPS | RT(TP99) / ms | RT(TP50) / ms | 故障/秒 |
| -------- | ------ | ----- | ------------- | ------------- | ------- |
| 8 | 500 | 7153 | 127 | 83 | 0 |
| 12 | 300 | 10248 | 63 | 24 | 0 |
| 16 | 600 | 14135 | 85 | 42 | 0 |
| 32 | 600 | 20281 | 63 | 28 | 0 |
![Search performance by Querynode CPU cores](https://milvus.io/docs/v2.6.x/assets/search_performance_by_querynode_cpu_cores.png)按 Querynode CPU 内核分列的搜索性能
### Milvus 2.2.0 扩展能力
使用更多 Querynodes 扩展更多副本,以检查扩展能力。
注意:加载 Collections 时,Querynodes 的数量等于`replica_number` 。
<details style="box-sizing: inherit; margin: 8px 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; display: block; line-height: 1.4em; color: rgb(25, 25, 25); font-family: Geist, Inter, &quot;Geist Mono&quot;, SourceCodePro, &quot;serif&quot;; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><summary style="box-sizing: inherit; margin: 0px 0px 8px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline; cursor: pointer; color: rgb(25, 25, 25);"><b style="box-sizing: inherit; margin: 0px; padding: 0px; border: 0px; font-size: 16px; vertical-align: baseline;">服务器配置(群集)</b></summary><code translate="no" style="box-sizing: inherit; margin: 0px; padding: 0px 8px; border: 0px; font-size: 14px; vertical-align: baseline; line-height: 1.4rem; font-family: SourceCodePro; background-color: rgb(208, 215, 220); border-radius: 4px; color: rgb(0, 19, 26); display: inline-block; font-weight: 600;"></code></details>
| 副本 | 并发数 | QPS | RT(TP99) / ms | RT(TP50) / ms | 故障/秒 |
| ---- | ------ | ----- | ------------- | ------------- | ------- |
| 1 | 500 | 7153 | 127 | 83 | 0 |
| 2 | 500 | 15903 | 105 | 27 | 0 |
| 4 | 800 | 19281 | 109 | 40 | 0 |
| 8 | 1200 | 30655 | 93 | 38 | 0 |
![Search performance by Querynode replicas](https://milvus.io/docs/v2.6.x/assets/search_performance_by_querynode_replicas.png)按 Querynode 复制的搜索性能