向量计算性能测试方案

更新时间:
复制 MD 格式

VectorDBBench 是为追求高性能数据存储和检索系统的用户设计的开源性能测试工具,它允许用户测试和比较不同向量数据库系统的性能,以确定最适合的数据库系统。原始代码请参见VectorDBBench官方仓库。本文为您介绍Hologres在VectorDBBench上进行性能对比测试的方法。

测试环境

测试环境如下:

  • Hologres实例规格:CPU:32 Core,内存:128 GB。

  • Hologres实例版本:V4.2.21、V5.0.3及以上版本。

  • ECS实例规格:建议ecs.c9i.16xlarge及以上规格。

说明
  • ECS与Hologres实例位于相同地域和可用区,并使用相同的VPC网络。

  • Hologres向量计算功能使用新版HGraph索引。

  • Hologres实例基于K8s容器化部署,由于向量检索的QPS极高,实际性能可能因网络和实际负载产生差异。

    如有问题,可在Hologres交流群反馈,加入Hologres交流群请参见如何获取更多的在线支持?。

测试过程

  1. 环境准备。

    • 准备Hologres实例。

      1. 购买Hologres实例 V4.2版本实例并创建数据库。

      2. 创建用户。具体操作,请参见用户管理。

    • 准备ECS实例。

      1. 购买ECS实例。具体操作,请参见控制台购买 Windows 实例并搭建 IIS Web服务。

      2. 安装依赖。

        1. (可选)安装Git,若已安装可跳过此步骤。

          apt-get update
          apt install git
        2. (可选)安装Python 3.11,若已安装可跳过此步骤。

          apt-get update
          apt install python3-full python3-venv
          
          cd /opt
          python3 -m venv venv
          source venv/bin/activate
  2. 安装VectorDBBench。

    # clone VectorDBBench
    # 部分PR合入中,本文测试暂时使用Hologres仓库
    git clone https://github.com/biaozy/VectorDBBench.git
    cd VectorDBBench
    
    # install deps
    pip3 install -U pip -i https://mirrors.aliyun.com/pypi/simple
    pip3 install --no-cache-dir -r install/requirements_py3.11.txt  -i https://mirrors.aliyun.com/pypi/simple
    pip3 install -e . -i https://mirrors.aliyun.com/pypi/simple
    
  3. 启动性能测试。指定Hologres的host(VPC endpoint)、port、user、password、database即可。

    # top100
    NUM_PER_BATCH=100000 vectordbbench hologreshgraph --host <hologres_instance_vpc_endpoint> --port <port> --user '<username>' --password <password> --database <database_name> --m 64 --ef-construction 400 --case-type Performance768D10M --index-type HGraph --ef-search 4000 --k 100 --num-concurrency 1,80,90,95,100,110,120,130 --db-label 32c128g-4.2 --concurrency-duration 10 --serial-cooldown 10
    
    # top10
    NUM_PER_BATCH=100000 vectordbbench hologreshgraph --host <hologres_instance_vpc_endpoint> --port <port> --user '<username>' --password <password> --database <database_name> --m 64 --ef-construction 400 --case-type Performance768D10M --index-type HGraph --ef-search 1000 --k 10 --num-concurrency 1,80,90,95,100,110,120,130 --db-label 32c128g-4.2 --concurrency-duration 10 --serial-cooldown 10

    如果多次重复跑性能时,可以在上述命令后面加上 --skip-drop-old --skip-load,可以跳过导入数据的过程。

    参数说明:

    参数

    说明

    hologres_instance_vpc_endpoint

    Hologres的网络信息和端口号。

    您可登录Hologres管理控制台,单击目标实例ID,在实例详情页的网络信息区域,获取对应的网络信息和端口号。

    port

    username&password

    Hologres实例的用户账号和密码。

    您可登录Hologres管理控制台,单击目标实例ID,在实例详情页单击用户管理,获取账号信息。

    database_name

    Hologres实例的数据库名称。

    您可登录Hologres管理控制台,单击目标实例ID,在实例详情页单击数据库管理,获取数据库信息。

测试结果

Hologres在查询QPS、召回率Recall、延迟Latency等性能指标的测试结果如下表。其中,Top 100场景的成绩明细请参见测试结果JSON文件。

说明

其他产品的VectorDBBench测试成绩会随官方榜单持续更新,如需了解详情,请参见VectorDBBench官方榜单。

数据集

TopK

QPS

Recall

Serial Latency P95(ms)

Serial Latency P99(ms)

Cohere 10M

10

97,540

99.51%

0.8

1.0

100

92,490

99.27%

1.0

1.1