本文介绍Tair(企业版)磁盘(SSD)型性能测试的测试环境、测试工具、测试方法与测试结果。
测试环境
测试环境信息 | 说明 |
地域和可用区域 | 所有测试均在华东1(杭州)地域的可用区I中完成。 |
Redis实例架构 | 标准版(双副本)架构,详情请参见标准架构。 |
部署压测工具的机器 | |
磁盘(SSD)型实例规格 |
|
测试主要针对下述两种场景进行:
内存大于数据场景:绝大部分数据可以在内存中访问到,此场景下内存与数据的比例约为7:1。
数据大于内存场景:只有部分数据缓存在内存,部分访问请求需要读取硬盘中的数据,根据负载不同,需要访问磁盘的比例也不一样,此场景下内存与数据的比例约为1:4。
测试工具
采用开源社区的YCSB压测工具进行压测。YCSB是一款Java编写的支持多种数据库的性能测试工具,具体安装和使用方法请参见YCSB。
本测试中,对YCSB的相关内容做了一定的修改,使其支持导入long类型的recordcount参数、支持测试Redis的String相关命令,修改后的完整源代码请参见YCSB源码。
测试命令
下述脚本以数据大于内存场景为例。
#! /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.localssd.c1m4.2xlarge | recordcount=40000000 run_operationcount=40000000 threads=64 | Load | 59830 | 1066 | 2761 |
Uniform-Read | 158221 | 389 | 891 | ||
Zipfian-Read | 164233 | 379 | 873 | ||
Uniform-50%Read-50%Update | 78099 | READ:651 | READ:2012 | ||
UPDATE:974 | UPDATE:2731 | ||||
tair.localssd.c1m4.4xlarge | recordcount=80000000 run_operationcount=80000000 threads=128 | Load | 91991 | 1388 | 3077 |
Uniform-Read | 302940 | 414 | 921 | ||
Zipfian-Read | 305639 | 410 | 899 | ||
Uniform-50%Read-50%Update | 124929 | READ:798 | READ:2231 | ||
UPDATE:1234 | UPDATE:3013 | ||||
tair.localssd.c1m4.8xlarge | recordcount=160000000 run_operationcount=160000000 threads=256 | Load | 132865 | 1924 | 3323 |
Uniform-Read | 489287 | 513 | 1313 | ||
Zipfian-Read | 501847 | 499 | 1272 | ||
Uniform-50%Read-50%Update | 187390 | READ:1069 | READ:2749 | ||
UPDATE:1644 | UPDATE:3613 |
数据大于内存场景
实例规格 | YCSB配置 | 工作负载 | QPS(次/秒) | Average Latency(微秒) | 99th Percentile Latency(微秒) |
tair.localssd.c1m4.2xlarge | recordcount=1280000000 run_operationcount=1280000000 threads=64 | Load | 50396 | 1258 | 4463 |
Uniform-Read | 74611 | 842 | 1745 | ||
Zipfian-Read | 106366 | 588 | 1406 | ||
Uniform-50%Read-50%Update | 47833 | READ:1232 | READ:4049 | ||
WRITE:1402 | WRITE:4583 | ||||
tair.localssd.c1m4.4xlarge | recordcount=2560000000 run_operationcount=2560000000 threads=128 | Load | 81097 | 1573 | 4119 |
Uniform-Read | 118141 | 1071 | 3085 | ||
Zipfian-Read | 194704 | 634 | 1595 | ||
Uniform-50%Read-50%Update | 75625 | READ:1562 | READ:4999 | ||
UPDATE:1795 | UPDATE:5419 | ||||
tair.localssd.c1m4.8xlarge | recordcount=5120000000 run_operationcount=5120000000 threads=256 | Load | 115660 | 2210 | 5235 |
Uniform-Read | 202365 | 1252 | 3985 | ||
Zipfian-Read | 309019 | 804 | 2551 | ||
Uniform-50%Read-50%Update | 122318 | READ:1861 | READ:5603 | ||
UPDATE:2307 | UPDATE:6415 |