本文介紹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 |