1. 压测结果
1.1 现有Milvus集群性能指标
版本:2.4.13-hotfox



1.2 新Milvus集群性能指标
版本:2.6.10

1.2.1 组件依赖方案一:Pulsar + langhorn【投产使用】


1.2.2 组件依赖方案二:Woodpecker + s3(yumc-obs)【弃用】
Woodpecker为Milvus官方研发的旨在替换Pulsar的组件,依赖 S3 进行数据持久化,使用公司OBS测试发现性能比较差,不推荐生产使用

1.3 结论(know-how):
- 核心升级:Milvus 2.6.10 新增稀疏索引、混合搜索、标量过滤等关键功能,突破稠密向量限制,支持复杂多模态检索。
- 性能:
- HNSW 在调优后 QPS 为 10,611(50K/1536D);
- IVF_FLAT 为 7,746 QPS;
- 延迟低(~4--5ms),召回率可控且精准(最高 0.9998)。
- 扩展:稳定支撑百万级高维向量,显著优于旧集群的数据规模能力。
- 架构:支持灵活存储与消息组件,资源调度和稳定性全面提升。
2.新集群配置
1.Woodpecker + s3


2.Pulsar + longhorn


3. 推荐压测索引类型
• 性能巅峰: HNSW (M=16, ef=64/128/256) - 展示最低延迟和最高 QPS。
• 内存效率: IVF_PQ (nlist=1000, m=16/32) - 展示高压缩比下的性能。
• 平衡之选: IVF_FLAT (nlist=1000) - 展示内存与精度的平衡。
• 超大容量: DISKANN (如果硬件支持,数据集足够大) - 展示极限规模处理能力。
4. 官方压测数据集

5. 推荐的索引类型 + 数据集抽样方案
核心思想:
• HNSW: 在内存允许的范围内,追求极致的搜索性能(低延迟、高 QPS、高 Recall)。
• IVF_PQ: 在内存受限的条件下,追求高容量和可接受的性能。
• IVF_FLAT: 在内存中等,需要较高精度时的平衡选择。
• DISKANN: 在数据超大,内存严重不足时的选择。

6. 压测工具
https://github.com/zilliztech/VectorDBBench/blob/main/README.md
7. 压测实例记录
压测地址 ip:172.25.203.51
执行命令:/usr/local/python3.12/bin/vectordbbench
1.HNSW 压测
1.维度 (Dim) 768D 规模 (Size) 1M
bash
/usr/local/python3.12/bin/vectordbbench milvushnsw --config-file HNSW_768D1M_config.yaml
milvushnsw:
uri: http://10.102.179.216:19530
token: root:Milvus
user_name: root
password: Milvus
case_type: Performance768D1M
m: 16
ef_construction: 128
ef_search: 128
skip_search_serial: False
drop_old: True
load: True
第一版 : woodpecker+ s3
bash
{
"run_id": "deafabe74615455b875a5b30abda9467",
"task_label": "deafabe74615455b875a5b30abda9467",
"results": [
{
"metrics": {
"max_load_count": 0,
"insert_duration": 2022.1231,
"optimize_duration": 49.7741,
"load_duration": 2071.8973,
"qps": 2048.7279,
"serial_latency_p99": 0.0046,
"serial_latency_p95": 0.0042,
"recall": 0.9594,
"ndcg": 0.9607,
"conc_num_list": [
1,
5,
10,
20,
30,
40,
60,
80
],
"conc_qps_list": [
290.8658,
1335.7063,
2048.7279,
1794.7399,
1526.9114,
1392.0178,
1348.8774,
1341.2897
],
"conc_latency_p99_list": [
0.0046309662610292445,
0.005014714673161508,
0.013253955543041231,
0.05681874930858612,
0.07293502420186997,
0.0822185344994068,
0.09298297643661499,
0.09977364718914035
],
"conc_latency_p95_list": [
0.004084292799234389,
0.004454576969146728,
0.005791787803173063,
0.05280712693929672,
0.06926763206720352,
0.07854105718433857,
0.08859767019748688,
0.09545291662216186
],
"conc_latency_avg_list": [
0.0034284238194102036,
0.003732595335539073,
0.004426685248524857,
0.010106101868511082,
0.017811695940470735,
0.026057484532537065,
0.04021914124297794,
0.053932476592788166
],
"st_ideal_insert_duration": 0,
"st_search_stage_list": [],
"st_search_time_list": [],
"st_max_qps_list_list": [],
"st_recall_list": [],
"st_ndcg_list": [],
"st_serial_latency_p99_list": [],
"st_serial_latency_p95_list": [],
"st_conc_failed_rate_list": [],
"st_conc_num_list_list": [],
"st_conc_qps_list_list": [],
"st_conc_latency_p99_list_list": [],
"st_conc_latency_p95_list_list": [],
"st_conc_latency_avg_list_list": []
},
"task_config": {
"db": "Milvus",
"db_config": {
"db_label": "2026-02-10T14:46:58.834881",
"version": "",
"note": "",
"uri": "**********",
"user": "root",
"password": "**********",
"num_shards": 1,
"replica_number": 1
},
"db_case_config": {
"index": "HNSW",
"metric_type": "COSINE",
"use_partition_key": false,
"M": 16,
"efConstruction": 128,
"ef": 128
},
"case_config": {
"case_id": 5,
"custom_case": {},
"k": 100,
"concurrency_search_config": {
"num_concurrency": [
1,
5,
10,
20,
30,
40,
60,
80
],
"concurrency_duration": 30,
"concurrency_timeout": 3600
}
},
"stages": [
"drop_old",
"load",
"search_serial",
"search_concurrent"
]
},
"label": ":)"
}
],
"file_fmt": "result_{}_{}_{}.json",
"timestamp": 1770652800.0
}
第二版 : pulsar+ langhorn
- drop_old: False load: False
bash
{
"run_id": "021e0bc95e674106adf4dd9debd4984c",
"task_label": "021e0bc95e674106adf4dd9debd4984c",
"results": [
{
"metrics": {
"max_load_count": 0,
"insert_duration": 0.0,
"optimize_duration": 0.0,
"load_duration": 0.0,
"qps": 4437.0207,
"serial_latency_p99": 0.0048,
"serial_latency_p95": 0.0042,
"recall": 0.9532,
"ndcg": 0.9554,
"conc_num_list": [
1,
5,
10,
20,
30,
40,
60,
80
],
"conc_qps_list": [
280.2861,
1281.1247,
2445.1799,
3836.81,
4069.0766,
4182.9167,
4294.0114,
4437.0207
],
"conc_latency_p99_list": [
0.0049152613431215336,
0.00471125528216362,
0.005382752418518067,
0.01715054012835026,
0.030020691156387277,
0.03584605544805529,
0.038697685375809664,
0.041603341698646545
],
"conc_latency_p95_list": [
0.004270192608237261,
0.004202932119369507,
0.004450275003910064,
0.008175489678978914,
0.021032161265611634,
0.028597639501094778,
0.033432529866695405,
0.036747634410858154
],
"conc_latency_avg_list": [
0.003557880797334093,
0.0035378130156735123,
0.003706951811260052,
0.004720339570485132,
0.0066806255421336365,
0.008653921474263204,
0.012596775286649506,
0.016302261126974266
],
"st_ideal_insert_duration": 0,
"st_search_stage_list": [],
"st_search_time_list": [],
"st_max_qps_list_list": [],
"st_recall_list": [],
"st_ndcg_list": [],
"st_serial_latency_p99_list": [],
"st_serial_latency_p95_list": [],
"st_conc_failed_rate_list": [],
"st_conc_num_list_list": [],
"st_conc_qps_list_list": [],
"st_conc_latency_p99_list_list": [],
"st_conc_latency_p95_list_list": [],
"st_conc_latency_avg_list_list": []
},
"task_config": {
"db": "Milvus",
"db_config": {
"db_label": "2026-02-11T14:51:28.148880",
"version": "",
"note": "",
"uri": "**********",
"user": "root",
"password": "**********",
"num_shards": 1,
"replica_number": 1
},
"db_case_config": {
"index": "HNSW",
"metric_type": "COSINE",
"use_partition_key": false,
"M": 16,
"efConstruction": 128,
"ef": 128
},
"case_config": {
"case_id": 5,
"custom_case": {},
"k": 100,
"concurrency_search_config": {
"num_concurrency": [
1,
5,
10,
20,
30,
40,
60,
80
],
"concurrency_duration": 30,
"concurrency_timeout": 3600
}
},
"stages": [
"search_serial",
"search_concurrent"
]
},
"label": ":)"
}
],
"file_fmt": "result_{}_{}_{}.json",
"timestamp": 1770739200.0
}
2.drop_old: True load: True
bash
{
"run_id": "df32e208c8f74820b4b23e1b3cad51d0",
"task_label": "df32e208c8f74820b4b23e1b3cad51d0",
"results": [
{
"metrics": {
"max_load_count": 0,
"insert_duration": 408.6767,
"optimize_duration": 95.7143,
"load_duration": 504.391,
"qps": 3918.5436,
"serial_latency_p99": 0.0042,
"serial_latency_p95": 0.0038,
"recall": 0.9546,
"ndcg": 0.9571,
"conc_num_list": [
1,
5,
10,
20,
30,
40,
60,
80
],
"conc_qps_list": [
260.6158,
1360.0389,
2376.1211,
3814.4623,
3918.5436,
2674.5322,
1968.7857,
2107.7096
],
"conc_latency_p99_list": [
0.00506292477250099,
0.004907384887337681,
0.005624561384320253,
0.017327040955424335,
0.03239459797739982,
0.039350545033812495,
0.0454706996679306,
0.053366898074746184
],
"conc_latency_p95_list": [
0.004462780803442001,
0.004352097958326339,
0.004610687866806983,
0.008221979439258573,
0.023745110258460028,
0.035137183219194415,
0.04228337109088898,
0.048492673411965365
],
"conc_latency_avg_list": [
0.003828727937644699,
0.003664708743040417,
0.00381450617081499,
0.004751887722275541,
0.006939257675564732,
0.013552476384678717,
0.027527292126019894,
0.03432166534689178
],
"st_ideal_insert_duration": 0,
"st_search_stage_list": [],
"st_search_time_list": [],
"st_max_qps_list_list": [],
"st_recall_list": [],
"st_ndcg_list": [],
"st_serial_latency_p99_list": [],
"st_serial_latency_p95_list": [],
"st_conc_failed_rate_list": [],
"st_conc_num_list_list": [],
"st_conc_qps_list_list": [],
"st_conc_latency_p99_list_list": [],
"st_conc_latency_p95_list_list": [],
"st_conc_latency_avg_list_list": []
},
"task_config": {
"db": "Milvus",
"db_config": {
"db_label": "2026-02-11T15:10:56.321069",
"version": "",
"note": "",
"uri": "**********",
"user": "root",
"password": "**********",
"num_shards": 1,
"replica_number": 1
},
"db_case_config": {
"index": "HNSW",
"metric_type": "COSINE",
"use_partition_key": false,
"M": 16,
"efConstruction": 128,
"ef": 128
},
"case_config": {
"case_id": 5,
"custom_case": {},
"k": 100,
"concurrency_search_config": {
"num_concurrency": [
1,
5,
10,
20,
30,
40,
60,
80
],
"concurrency_duration": 30,
"concurrency_timeout": 3600
}
},
"stages": [
"drop_old",
"load",
"search_serial",
"search_concurrent"
]
},
"label": ":)"
}
],
"file_fmt": "result_{}_{}_{}.json",
"timestamp": 1770739200.0
}
2.维度 (Dim) 1536D 规模 (Size) 500K
bash
{
"run_id": "ac5272026a4046b9b6546f78eec1d9cf",
"task_label": "ac5272026a4046b9b6546f78eec1d9cf",
"results": [
{
"metrics": {
"max_load_count": 0,
"insert_duration": 396.7856,
"optimize_duration": 228.8378,
"load_duration": 625.6234,
"qps": 684.9286,
"serial_latency_p99": 0.0158,
"serial_latency_p95": 0.0147,
"recall": 0.9998,
"ndcg": 0.9999,
"conc_num_list": [
1,
5,
10,
20,
30,
40,
60,
80
],
"conc_qps_list": [
73.3182,
337.2355,
679.2893,
644.0747,
669.2649,
678.457,
682.2168,
684.9286
],
"conc_latency_p99_list": [
0.018961942344903934,
0.01815169841051102,
0.02019314646720886,
0.04139214463531971,
0.05240628056228162,
0.06539209112524988,
0.08918024845421316,
0.11746256008744241
],
"conc_latency_p95_list": [
0.01647482328116894,
0.016651205718517303,
0.018313062191009522,
0.0377856221050024,
0.04916682317852974,
0.06168357394635677,
0.08606301210820674,
0.11096167415380477
],
"conc_latency_avg_list": [
0.013610356303097548,
0.01345016602291442,
0.014685056555373286,
0.02818945662501486,
0.040668109398712494,
0.053478187437690124,
0.0796451137650894,
0.10567775456957264
],
"st_ideal_insert_duration": 0,
"st_search_stage_list": [],
"st_search_time_list": [],
"st_max_qps_list_list": [],
"st_recall_list": [],
"st_ndcg_list": [],
"st_serial_latency_p99_list": [],
"st_serial_latency_p95_list": [],
"st_conc_failed_rate_list": [],
"st_conc_num_list_list": [],
"st_conc_qps_list_list": [],
"st_conc_latency_p99_list_list": [],
"st_conc_latency_p95_list_list": [],
"st_conc_latency_avg_list_list": []
},
"task_config": {
"db": "Milvus",
"db_config": {
"db_label": "2026-02-11T15:39:00.706953",
"version": "",
"note": "",
"uri": "**********",
"user": "root",
"password": "**********",
"num_shards": 1,
"replica_number": 1
},
"db_case_config": {
"index": "HNSW",
"metric_type": "COSINE",
"use_partition_key": false,
"M": 32,
"efConstruction": 400,
"ef": 500
},
"case_config": {
"case_id": 10,
"custom_case": {},
"k": 100,
"concurrency_search_config": {
"num_concurrency": [
1,
5,
10,
20,
30,
40,
60,
80
],
"concurrency_duration": 30,
"concurrency_timeout": 3600
}
},
"stages": [
"drop_old",
"load",
"search_serial",
"search_concurrent"
]
},
"label": ":)"
}
],
"file_fmt": "result_{}_{}_{}.json",
"timestamp": 1770739200.0
}
3.维度 (Dim) 1536D 规模 (Size) 50K
bash
milvushnsw:
uri: http://10.102.179.216:19530
token: root:Milvus
user_name: root
password: Milvus
case_type: Performance1536D50K
m: 8
ef_construction: 64
ef_search: 10
k: 10
skip_search_serial: False
drop_old: True
load: False
bash
{
"run_id": "970698c0396345a5a6f2fcf7d5b87d96",
"task_label": "970698c0396345a5a6f2fcf7d5b87d96",
"results": [
{
"metrics": {
"max_load_count": 0,
"insert_duration": 42.4296,
"optimize_duration": 22.1165,
"load_duration": 64.5461,
"qps": 10611.8353,
"serial_latency_p99": 0.0036,
"serial_latency_p95": 0.0029,
"recall": 0.7268,
"ndcg": 0.7437,
"conc_num_list": [
1,
5,
10,
20,
30,
40,
60,
80
],
"conc_qps_list": [
467.9527,
2117.4651,
4172.0285,
7692.8731,
9324.3746,
9812.9591,
10611.8353,
7874.284
],
"conc_latency_p99_list": [
0.003216152489185332,
0.0031679566204547882,
0.003205683603882787,
0.0037914239615201937,
0.011091489270329505,
0.020689377188682516,
0.027636634111404372,
0.03050287716090678
],
"conc_latency_p95_list": [
0.0027596548199653624,
0.002712687849998474,
0.002723605930805206,
0.0029333502054214467,
0.004308551549911499,
0.006058933213353157,
0.0109823912382126,
0.015056878328323323
],
"conc_latency_avg_list": [
0.002130294303030087,
0.0021398399277073846,
0.0021710237891970252,
0.002352367631151417,
0.00290683272835572,
0.0036742699596471265,
0.005084496899646619,
0.00571432771323781
],
"st_ideal_insert_duration": 0,
"st_search_stage_list": [],
"st_search_time_list": [],
"st_max_qps_list_list": [],
"st_recall_list": [],
"st_ndcg_list": [],
"st_serial_latency_p99_list": [],
"st_serial_latency_p95_list": [],
"st_conc_failed_rate_list": [],
"st_conc_num_list_list": [],
"st_conc_qps_list_list": [],
"st_conc_latency_p99_list_list": [],
"st_conc_latency_p95_list_list": [],
"st_conc_latency_avg_list_list": []
},
"task_config": {
"db": "Milvus",
"db_config": {
"db_label": "2026-02-12T10:40:52.319662",
"version": "",
"note": "",
"uri": "**********",
"user": "root",
"password": "**********",
"num_shards": 1,
"replica_number": 1
},
"db_case_config": {
"index": "HNSW",
"metric_type": "COSINE",
"use_partition_key": false,
"M": 8,
"efConstruction": 64,
"ef": 10
},
"case_config": {
"case_id": 50,
"custom_case": {},
"k": 10,
"concurrency_search_config": {
"num_concurrency": [
1,
5,
10,
20,
30,
40,
60,
80
],
"concurrency_duration": 30,
"concurrency_timeout": 3600
}
},
"stages": [
"drop_old",
"load",
"search_serial",
"search_concurrent"
]
},
"label": ":)"
}
],
"file_fmt": "result_{}_{}_{}.json",
"timestamp": 1770825600.0
}
2.IVF_FLAT 压测
1.维度 (Dim) 768D 规模 (Size) 1M
bash
YAML
milvusivfflat:
uri: http://10.102.179.216:19530 # Milvus 服务地址
token: root:Milvus # 认证信息,如果使用 token
user_name: root # 用户名
password: Milvus # 密码
case_type: Performance768D1M1P # 测试案例类型,指定为 768维 100万条
nlist: 16384 # IVF 参数,聚类中心数量。可根据数据量调整,1M 数据常用
nprobe: 16
drop_old: True
load: True
skip_search_serial: False
bash
{
"run_id": "ee82e8ca42fe43a3801c9b738fbc7d3f",
"task_label": "ee82e8ca42fe43a3801c9b738fbc7d3f",
"results": [
{
"metrics": {
"max_load_count": 0,
"insert_duration": 428.9192,
"optimize_duration": 817.6954,
"load_duration": 1246.6146,
"qps": 3689.3624,
"serial_latency_p99": 0.0064,
"serial_latency_p95": 0.0056,
"recall": 0.7376,
"ndcg": 0.7641,
"conc_num_list": [
1,
5,
10,
20,
30,
40,
60,
80
],
"conc_qps_list": [
216.1282,
1122.1388,
2193.2338,
2981.755,
3308.8468,
3358.6903,
3542.2557,
3689.3624
],
"conc_latency_p99_list": [
0.00707444280385971,
0.005861456617712971,
0.006325698047876359,
0.021504428982734677,
0.0330368023365736,
0.035742913782596586,
0.039478159025311446,
0.04314859926700592
],
"conc_latency_p95_list": [
0.0056299477815628055,
0.0052268017083406445,
0.005435665696859359,
0.014162710309028593,
0.027549127116799355,
0.030825757980346678,
0.034735937416553495,
0.038368743658065786
],
"conc_latency_avg_list": [
0.004616444739092118,
0.00444185091170997,
0.004543724516765225,
0.0060794347052255905,
0.008215379890531343,
0.0107923086993406,
0.015314256830185611,
0.01953278024173921
],
"st_ideal_insert_duration": 0,
"st_search_stage_list": [],
"st_search_time_list": [],
"st_max_qps_list_list": [],
"st_recall_list": [],
"st_ndcg_list": [],
"st_serial_latency_p99_list": [],
"st_serial_latency_p95_list": [],
"st_conc_failed_rate_list": [],
"st_conc_num_list_list": [],
"st_conc_qps_list_list": [],
"st_conc_latency_p99_list_list": [],
"st_conc_latency_p95_list_list": [],
"st_conc_latency_avg_list_list": []
},
"task_config": {
"db": "Milvus",
"db_config": {
"db_label": "2026-02-11T16:31:28.264073",
"version": "",
"note": "",
"uri": "**********",
"user": "root",
"password": "**********",
"num_shards": 1,
"replica_number": 1
},
"db_case_config": {
"index": "IVF_FLAT",
"metric_type": "COSINE",
"use_partition_key": false,
"nlist": 16384,
"nprobe": 16
},
"case_config": {
"case_id": 7,
"custom_case": {},
"k": 100,
"concurrency_search_config": {
"num_concurrency": [
1,
5,
10,
20,
30,
40,
60,
80
],
"concurrency_duration": 30,
"concurrency_timeout": 3600
}
},
"stages": [
"drop_old",
"load",
"search_serial",
"search_concurrent"
]
},
"label": ":)"
}
],
"file_fmt": "result_{}_{}_{}.json",
"timestamp": 1770739200.0
}
2.维度 (Dim) 1536D 规模 (Size) 50K
bash
YAML
/usr/local/python3.12/bin/vectordbbench milvushnsw --config-file HNSW_768D1M_config.yaml
milvusivfflat:
uri: http://10.102.179.216:19530 # Milvus 服务地址
token: root:Milvus # 认证信息,如果使用 token
user_name: root # 用户名
password: Milvus # 密码
case_type: Performance1536D50K
nlist: 1024
nprobe: 5
drop_old: True
load: True
skip_search_serial: False
bash
{
"run_id": "e6b204132447423b9e37ff27622121a5",
"task_label": "e6b204132447423b9e37ff27622121a5",
"results": [
{
"metrics": {
"max_load_count": 0,
"insert_duration": 43.6187,
"optimize_duration": 38.1563,
"load_duration": 81.775,
"qps": 7746.36,
"serial_latency_p99": 0.0051,
"serial_latency_p95": 0.004,
"recall": 0.4966,
"ndcg": 0.5397,
"conc_num_list": [
1,
5,
10,
20,
30,
40,
60,
80
],
"conc_qps_list": [
343.0982,
1769.3554,
3607.7665,
6037.7365,
7494.3443,
7680.221,
7418.2503,
7746.36
],
"conc_latency_p99_list": [
0.004579741954803461,
0.0044055619835853465,
0.004131422340869903,
0.004977263063192368,
0.022138307392597187,
0.03134996473789213,
0.039785966575145715,
0.044772748649120335
],
"conc_latency_p95_list": [
0.0038012236356735228,
0.0035690214484930035,
0.0034280672669410703,
0.0037759579718112946,
0.006040090322494505,
0.014635354280471802,
0.030681259557604788,
0.03669592142105102
],
"conc_latency_avg_list": [
0.0029069715668887898,
0.002816494550219217,
0.0027590876787901746,
0.0029962346416555915,
0.003967914839129762,
0.005153798387176018,
0.007271051428452484,
0.009257836858343164
],
"st_ideal_insert_duration": 0,
"st_search_stage_list": [],
"st_search_time_list": [],
"st_max_qps_list_list": [],
"st_recall_list": [],
"st_ndcg_list": [],
"st_serial_latency_p99_list": [],
"st_serial_latency_p95_list": [],
"st_conc_failed_rate_list": [],
"st_conc_num_list_list": [],
"st_conc_qps_list_list": [],
"st_conc_latency_p99_list_list": [],
"st_conc_latency_p95_list_list": [],
"st_conc_latency_avg_list_list": []
},
"task_config": {
"db": "Milvus",
"db_config": {
"db_label": "2026-02-12T11:13:43.309460",
"version": "",
"note": "",
"uri": "**********",
"user": "root",
"password": "**********",
"num_shards": 1,
"replica_number": 1
},
"db_case_config": {
"index": "IVF_FLAT",
"metric_type": "COSINE",
"use_partition_key": false,
"nlist": 1024,
"nprobe": 5
},
"case_config": {
"case_id": 50,
"custom_case": {},
"k": 100,
"concurrency_search_config": {
"num_concurrency": [
1,
5,
10,
20,
30,
40,
60,
80
],
"concurrency_duration": 30,
"concurrency_timeout": 3600
}
},
"stages": [
"drop_old",
"load",
"search_serial",
"search_concurrent"
]
},
"label": ":)"
}
],
"file_fmt": "result_{}_{}_{}.json",
"timestamp": 1770825600.0
}
附录:
参数说明
HNSW
• "index": "HNSW"
○ 含义: 一种基于图结构的高效近似最近邻 (ANN) 搜索算法,通过构建多层导航图来加速搜索。
• "metric_type":
○ 含义: 指定向量之间的距离度量方式。常见的有 COSINE (余弦距离) 和 L2 (欧氏距离)。COSINE 衡量向量方向差异,L2 衡量向量空间中的直线距离。
• "M"
○ 含义: HNSW 索引构建参数。控制图中每一层内部节点的连接数。M 定义了每个节点在其所在层级最多可以有多少个邻居。较大的 M 值会增加图的连通性,可能提高搜索精度和召回率,但也会增加内存使用量和索引构建时间。(广度)
• "efConstruction"
○ 含义: HNSW 索引构建参数。控制索引构建过程中的探索范围。在插入一个新节点时,算法会在这个参数设定的范围内寻找合适的邻居节点进行连接。较大的 efConstruction 值通常能构建出质量更高(连通性更好)的索引,有利于提高搜索质量,但会显著增加索引构建的时间和计算开销。(深度)
• "ef"
○ 含义: 这是搜索时的参数(通常在搜索 API 的 param 中指定,但在某些配置或测试场景中可能会预先设定或关联)。控制 HNSW 搜索过程中的探索范围。ef 值越大,搜索时访问的节点越多,结果越精确(接近暴力搜索),但速度越慢。ef 的值必须大于或等于实际要返回的 Top-K 结果数量
• "k"
○ 含义: 搜索参数。指本次搜索希望返回的最相似结果的数量,即 top-k 中的 k。它决定了搜索算法最终会输出多少个最相近的向量。k 的值必须小于或等于搜索时的 ef 参数值。
IVF_FLAT
• "index": "IVF_FLAT"
○ 含义: 指定使用的索引类型为 IVF_FLAT,一种基于量化(聚类)的索引方法。(本质上是一种基于倒排索引思想的向量检索方法)
• "metric_type"
○ 含义: 同 HNSW,指定向量之间的距离度量方式。
• "nlist"
○ 含义: IVF 系列索引的核心构建参数。代表将向量数据聚类成的簇(Cluster)或桶(Bucket)的数量。nlist 的选择影响索引构建时间和内存使用。该值在创建索引时必须指定,例如 {"nlist": 2048}。
• "nprobe"
○ 含义: IVF 系列索引的搜索参数。指在搜索时,需要探测(查询)多少个最近的簇。nprobe 的值越大,搜索覆盖的范围越广,召回率越高,但速度越慢;nprobe 的值越小,速度越快,但可能牺牲召回率。该值在执行搜索时通过 param 指定,例如 {"nprobe": 10}。
测试指标:
• insert_duration, load_duration:
○ 含义: insert_duration衡量将所有测试数据插入到向量数据库(如 Milvus 集合)中所花费的总时间。这包括了数据传输、写入磁盘/内存等整个过程
▪ load_duration
○ 含义:衡量将创建好索引的数据加载到数据库查询缓存/内存中所花费的时间。在 Milvus 中,数据只有被 load() 加载后,才能被用于高速的向量相似度搜索。这个时间反映了数据准备好供查询服务的速度。
○ 单位: 秒 (seconds)
• qps (Queries Per Second):
○ 含义: 串行查询下的延迟 99 百分位数。它表示在单个线程(或低并发)顺序执行查询时,99% 的查询请求所经历的响应时间。这是一个衡量单次查询性能的重要指标,P99 比平均延迟更能反映极端情况下的性能表现。
○ 单位: 次/秒 (queries per second)
• serial_latency_p99
○ 含义: 串行查询下的延迟 99 百分位数。它表示在单个线程(或低并发)顺序执行查询时,99% 的查询请求所经历的响应时间。这是一个衡量单次查询性能的重要指标,P99 比平均延迟更能反映极端情况下的性能表现。
○ 单位: 秒 (seconds)
• conc_latency_p99_list
○ 含义: 并发查询下的延迟 99 百分位数列表。它记录了在不同并发级别下执行查询时,各自对应的 P99 延迟。例如,列表中的第一个值可能对应 1 个并发线程的 P99 延迟,第二个值对应 2 个并发线程的 P99 延迟,依此类推。这有助于分析随着并发量增加,系统延迟的变化趋势,观察系统在压力下的表现。
○ 单位: 秒 (seconds)
• recall:
○ 单位: 无 (比例/百分比)
○ 含义: 召回率。表示在所有应该被检索到的相关结果中,实际被检索到的比例。通常用小数形式表示(0.0 到 1.0),也可以乘以100%得到百分比。
○ 说明: 0.9594 表示召回率为 95.94%。