本文介绍云原生内存数据库Tair磁盘(ESSD)型性能测试的测试环境、测试工具、测试方法与测试结果。
测试环境
测试环境信息 | 说明 |
地域和可用区域 | 所有测试均在华东1(杭州)地域的可用区I中完成。 |
Redis实例架构 | 标准版(双副本)架构,详情请参见标准架构。 |
部署压测工具的机器 | |
磁盘(ESSD)型实例规格 |
规格详情请参见磁盘型实例规格。 |
测试主要针对下述两种场景进行:
内存大于数据场景:绝大部分数据可以在内存中访问到,此场景下内存与数据的比例约为7:1。
数据大于内存场景:只有部分数据缓存在内存,部分访问请求需要读取硬盘中的数据,根据负载不同,需要访问磁盘的比例也不一样,此场景下内存与数据的比例约为1:4。
测试工具
采用开源社区的YCSB压测工具进行压测。YCSB是一款Java编写的支持多种数据库的性能测试工具,具体安装和使用方法请参见YCSB。
本测试中,对YCSB的相关内容做了一定的修改,使其支持导入long类型的recordcount参数、支持测试Redis的String相关命令,修改后的完整源代码请参见YCSB源码。
工作负载
Load:100%的String SET操作(写操作)。
Uniform-Read:采用Workload A,100%均匀随机String GET操作(读操作),主要测试严苛条件下的读性能。
Zipfian-Read:采用Workload C,数据分布方法为zipfian,测试大部分读请求访问小部分数据的性能,符合大部分的读场景。
Uniform-50%Read-50%Update:采用Workload A,50%的String SET操作(更新操作)与50%的String GET操作,主要测试随机更新的性能。
关于Workload的详细介绍,请参见Core Workloads。
测试命令
下述脚本以数据大于内存场景为例。
#! /bin/bash
ip=192.168.0.23
port=3100
timeout=30000
command_group=string
recordcount=640000000
run_operationcount=20000000
fieldcount=1
fieldlength=100
threads=32
load_sleep_time=600
run_sleep_time=60
echo "##################################### $command_group ############################################"
#Load
./bin/ycsb load redis -s -P workloads/workloada -p "redis.host=${ip}" -p "redis.port=${port}" -p "recordcount=${recordcount}" -p "operationcount=${recordcount}" -p "redis.timeout=${timeout}" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -threads ${threads}
sleep ${load_sleep_time}
#Uniform-Read
./bin/ycsb run redis -s -P workloads/workloadc -p "redis.host=${ip}" -p "redis.port=${port}" -p "recordcount=${recordcount}" -p "operationcount=${run_operationcount}" -p "redis.timeout=${timeout}" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -p "requestdistribution=uniform" -threads ${threads}
sleep ${run_sleep_time}
#Zipfian-Read
./bin/ycsb run redis -s -P workloads/workloadc -p "redis.host=${ip}" -p "redis.port=${port}" -p "recordcount=${recordcount}" -p "operationcount=${run_operationcount}" -p "redis.timeout=${timeout}" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -p "requestdistribution=zipfian" -threads ${threads}
sleep ${run_sleep_time}
#Uniform-50%Read-50%Update
./bin/ycsb run redis -s -P workloads/workloada -p "redis.host=${ip}" -p "redis.port=${port}" -p "recordcount=${recordcount}" -p "operationcount=${run_operationcount}" -p "redis.timeout=${timeout}" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -p "requestdistribution=uniform" -threads ${threads}
表 1. 参数说明
参数 | 说明 |
ip | Tair实例的IP地址。 |
port | Tair实例的服务端口。 |
timeout | 测试命令的超时时间,单位为ms。 |
command_group | 测试类型,配置为String。 |
recordcount | 数据加载阶段准备的数据量。 |
run_operationcount | Run阶段操作的数据量。本测试中:
|
fieldcount | 字段个数,配置为1。 |
fieldlength | 值长度,配置为100。 |
threads | YCSB线程数,根据实例规格配置。 |
测试结果
测试指标 | 说明 |
QPS | 每秒处理的读写操作数,单位为次/秒。 |
Average Latency | 读或写操作的平均延迟,单位为微秒(us)。 |
99th Percentile Latency | 处理速度最快的99%的操作中,最长的延迟时间,单位为微秒。例如该指标的值为500微秒,表示99%的请求可以在500微秒内被处理。 |
内存大于数据场景
实例规格 | YCSB配置 | 工作负载 | QPS(次/秒) | Average Latency(微秒) | 99th Percentile Latency(微秒) |
tair.essd.standard.xlarge | recordcount=20000000 run_operationcount=20000000 threads=32 | Load | 36740 | 851 | 1595 |
Uniform-Read | 103890 | 294 | 907 | ||
Zipfian-Read | 106357 | 288 | 865 | ||
Uniform-50%Read-50%Update | 46610 | Read:530 | Read:1108 | ||
Update:795 | Update:1684 | ||||
tair.essd.standard.2xlarge | recordcount=40000000 run_operationcount=40000000 threads=50 | Load | 54670 | 911 | 1528 |
Uniform-Read | 150796 | 314 | 995 | ||
Zipfian-Read | 151110 | 314 | 977 | ||
Uniform-50%Read-50%Update | 69137 | Read:537 | Read:948 | ||
Update:878 | Update:1479 | ||||
air.essd.standard.4xlarge | recordcount=80000000 run_operationcount=80000000 threads=100 | Load | 90703 | 1099 | 1697 |
Uniform-Read | 285833 | 339 | 1196 | ||
Zipfian-Read | 288750 | 335 | 1162 | ||
Uniform-50%Read-50%Update | 110316 | Read:757 | Read:1114 | ||
Update:1041 | Update:1536 | ||||
tair.essd.standard.8xlarge | recordcount=160000000 run_operationcount=160000000 threads=120 | Load | 117581 | 1011 | 1692 |
Uniform-Read | 477099 | 242 | 784 | ||
Zipfian-Read | 494550 | 234 | 727 | ||
Uniform-50%Read-50%Update | 196245 | Read:519 | Read:829 | ||
Update:691 | Update:1096 | ||||
tair.essd.standard.13xlarge | recordcount=240000000 run_operationcount=240000000 threads=160 | Load | 126366 | 1249 | 2281 |
Uniform-Read | 673183 | 231 | 637 | ||
Zipfian-Read | 691383 | 230 | 652 | ||
Uniform-50%Read-50%Update | 197803 | Read:678 | Read:940 | ||
Update:935 | Update:1925 |
数据大于内存场景
实例规格 | YCSB配置 | 工作负载 | QPS(次/秒) | Average Latency(微秒) | 99th Percentile Latency(微秒) |
tair.essd.standard.xlarge | recordcount=640000000 run_operationcount=20000000 threads=32 | Load | 25561 | 1245 | 3497 |
Uniform-Read | 25727 | 1239 | 2042 | ||
Zipfian-Read | 47559 | 667 | 1217 | ||
Uniform-50%Read-50%Update | 19731 | Read:1576 | Read:6383 | ||
Update:1639 | Update:6487 | ||||
tair.essd.standard.2xlarge | recordcount=1280000000 run_operationcount=40000000 threads=50 | Load | 42287 | 1179 | 3465 |
Uniform-Read | 35794 | 1394 | 1880 | ||
Zipfian-Read | 77759 | 637 | 1219 | ||
Uniform-50%Read-50%Update | 28656 | Read:1716 | Read:8863 | ||
Update:1761 | Update:8951 | ||||
air.essd.standard.4xlarge | recordcount=2560000000 run_operationcount=80000000 threads=100 | Load | 65923 | 1514 | 6615 |
Uniform-Read | 44753 | 2232 | 7903 | ||
Zipfian-Read | 120337 | 826 | 1382 | ||
Uniform-50%Read-50%Update | 38470 | Read:2577 | Read:8535 | ||
Update:2617 | Update:8583 | ||||
tair.essd.standard.8xlarge | recordcount=5120000000 run_operationcount=160000000 threads=120 | Load | 89231 | 1340 | 9575 |
Uniform-Read | 51175 | 2343 | 2955 | ||
Zipfian-Read | 131317 | 911 | 1573 | ||
Uniform-50%Read-50%Update | 38930 | Read:3063 | Read:8695 | ||
Update:3097 | Update:8735 | ||||
tair.essd.standard.13xlarge | recordcount=7680000000 run_operationcount=240000000 threads=160 | Load | 92163 | 1733 | 9879 |
Uniform-Read | 51267 | 3510 | 16623 | ||
Zipfian-Read | 138522 | 1152 | 2131 | ||
Uniform-50%Read-50%Update | 39584 | Read:4022 | Read:12159 | ||
Update:4057 | Update:12239 |