本文介绍PolarDB MySQL企业版8.0.2版本的Orca性能测试结果。
测试环境
ECS实例和PolarDB MySQL版集群位于同一地域和专有网络VPC内。
PolarDB MySQL版集群配置:
集群规格:集群版系列、数据库引擎版本为MySQL 8.0.2、节点规格为polar.mysql.x4.2xlarge(16核64 GB)、存储类型为PSL5。
参数配置:开启Blink-tree索引加速功能(
loose_innodb_polar_blink_tree=ON
),以提升查询性能。
ECS实例配置:1台ecs.c8i.16xlarge(64核128 GB),并通过Orca私网连接地址连接,确保在专有网络VPC内实现高效、安全的数据传输和访问性能。
测试工具
测试采用Redis Labs的多线程压测工具memtier benchmark。
性能测试
测试场景
我们针对Orca功能在128并发和512并发两种场景下,分别测试了Ping-Pong和Pipeline两种网络机制的性能结果。
并发数 | Value大小 | 线程数 | 每个线程的连接数 | 总连接数 | 每个连接的操作次数 | Key范围 | 数据总量 |
128 并发 | 128 Byte | 32 | 4 | 128 | 2,000,000 | [1, 128,000,000] | 约30 GB |
4096 Byte | 32 | 4 | 128 | 200,000 | [1, 12,800,000] | 约60 GB | |
16 KB | 32 | 4 | 128 | 200,000 | [1, 12,800,000] | 约750 GB | |
512 并发 | 128 Byte | 32 | 16 | 512 | 2,000,000 | [1, 512,000,000] | 约150 GB |
4096 Byte | 32 | 16 | 512 | 200,000 | [1, 51,200,000] | 约250 GB | |
16 KB | 32 | 16 | 512 | 200,000 | [1, 51,200,000] | 约1.5 TB |
表格参数说明如下:
字段 | 说明 |
并发数 | 表示测试中使用的总连接数,分别为128并发和512并发两种场景。 |
Value大小 | 测试中使用的数据值大小,分别为128Byte、4096Byte和16KB。 |
线程数 | 每个测试场景中使用的线程数,均为32个线程。 |
每个线程的连接数 | 每个线程创建的Client连接数,128并发场景为4个,512并发场景为16个。 |
总连接数 | 线程数×每个线程的连接数,即总并发连接数。 |
每个连接的操作次数 | 每个连接执行的写入和读取操作次数。 |
Key范围 | 写入和读取操作的Key随机生成范围。 |
数据总量 | 根据Value大小、操作次数和连接数计算得出的总数据量。 |
测试指标
指标 | 说明 |
QPS | 每秒执行的读写操作数,单位为次/秒。 说明 QPS 是衡量系统吞吐能力的关键指标,数值越高,系统处理能力越强。 |
Avg Latency | 读写操作的平均时延,单位为毫秒 (ms)。 说明 Avg Latency反映系统的平均响应速度,数值越低,用户体验越好。 |
p99 Latency | 99%的操作都低于该时延,单位为毫秒 (ms)。 说明 p99 Latency是衡量系统性能稳定性的重要指标,数值越低,系统在高负载下的表现越稳定。 |
测试结果
128 并发
在执行过程中,若遇到以下两种认证错误提示:
"error: authentication failed [-ERR wrong number of arguments for 'auth'/'hello' command.]"
"error: authentication failed [-WRONGPASS invalid username-password pair or user is disabled.]"
请按照以下步骤进行修正:
根据memtier_benchmark官方文档的认证参数规范,您需要将认证参数中的"-a $password"
替换为完整的账号密码格式,即使用"-a username:password"
的形式,其中username
替换为您的实际用户名,password
替换为对应的密码。
128 Byte测试命令
128并发128 Byte的Ping-Pong纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=128000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
128并发128 Byte的Ping-Pong纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=128000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
128并发128 Byte的Ping-Pong读写混合测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=128000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
128并发下128 Byte的Pipeline纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=128000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
128并发下128 Byte的Pipeline纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=128000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
128并发下128 Byte的Pipeline读写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=128000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
4096 Byte测试命令
128并发下4096 Byte的Ping-Pong纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
128并发下4096 Byte的Ping-Pong纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
128并发下4096 Byte的Ping-Pong读写混合测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
128并发下4096 Byte的Pipeline纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
128并发下4096 Byte的Pipeline纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
128并发下4096 Byte的Pipeline读写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
16 KB测试命令
128并发下16 KB的Ping-Pong纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
128并发下16 KB的Ping-Pong纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
128并发下16 KB的Ping-Pong读写混合测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
128并发下16 KB的Pipeline纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
128并发下16 KB的Pipeline纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
128并发下16 KB的Pipeline读写测试。
memtier_benchmark -s $host -p $port -a $password -c 4 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=12800000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
测试结果性能对比如下:
测试场景 | QPS | Avg Latency | p99 Latency |
Ping-Pong 纯写测试 (128 并发,128 Byte) | 87218.00 | 1.47 | 4.95 |
Ping-Pong 纯读测试 (128 并发,128 Byte) | 293096.26 | 0.44 | 2.17 |
Ping-Pong 读写混合测试 (128 并发,128 Byte) | 165345.18 | 0.76 | 3.31 |
Pipeline 纯写测试 (128 并发,128 Byte) | 286222.75 | 14.30 | 81.40 |
Pipeline 纯读测试 (128 并发,128 Byte) | 1092862.33 | 3.77 | 32.63 |
Pipeline 读写混合测试 (128 并发,128 Byte) | 237017.79 | 17.26 | 65.27 |
Ping-Pong 纯写测试 (128 并发,4096 Byte) | 38831.60 | 3.29 | 41.47 |
Ping-Pong 纯读测试 (128 并发,4096 Byte) | 220300.66 | 0.59 | 3.16 |
Ping-Pong 读写混合测试 (128 并发,4096 Byte) | 98865.79 | 1.29 | 11.07 |
Pipeline 纯写测试 (128 并发,4096 Byte) | 59170.52 | 69.74 | 444.41 |
Pipeline 纯读测试 (128 并发,4096 Byte) | 687123.90 | 6.74 | 15.35 |
Pipeline 读写混合测试 (128 并发,4096 Byte) | 107992.27 | 38.90 | 155.64 |
Ping-Pong 纯写测试 (128 并发,16 KB) | 9026.06 | 14.05 | 113.66 |
Ping-Pong 纯读测试 (128 并发,16 KB) | 146768.22 | 0.89 | 2.51 |
Ping-Pong 读写混合测试 (128 并发,16 KB) | 18204.85 | 7.09 | 96.25 |
Pipeline 纯写测试 (128 并发,16 KB) | 8937.17 | 456.24 | 2326.52 |
Pipeline 纯读测试 (128 并发,16 KB) | 160084.54 | 25.69 | 43.77 |
Pipeline 读写混合测试 (128 并发,16 KB) | 18893.23 | 216.60 | 374.78 |
512 并发
在执行过程中,若遇到以下两种认证错误提示:
"error: authentication failed [-ERR wrong number of arguments for 'auth'/'hello' command.]"
"error: authentication failed [-WRONGPASS invalid username-password pair or user is disabled.]"
请按照以下步骤进行修正:
根据memtier_benchmark官方文档的认证参数规范,您需要将认证参数中的"-a $password"
替换为完整的账号密码格式,即使用"-a username:password"
的形式,其中username
替换为您的实际用户名,password
替换为对应的密码。
128 Byte测试命令
512并发下128 Byte的Ping-Pong纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=512000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
512并发下128 Byte的Ping-Pong纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=512000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
512并发下128 Byte的Ping-Pong读写混合测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=512000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
512并发下128 Byte的Pipeline纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=512000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
512并发下128 Byte的Pipeline纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=512000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
512并发下128 Byte的Pipeline读写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 2000000 --random-data --randomize --distinct-client-seed -d 128 --key-maximum=512000000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
4096 Byte测试命令
512并发下4096 Byte的Ping-Pong纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
512并发下4096 Byte的Ping-Pong纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
512并发下4096 Byte的Ping-Pong读写混合测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
512并发下4096 Byte的Pipeline纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
512并发下4096 Byte的Pipeline纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
512并发下4096 Byte的Pipeline读写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 4096 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
16 KB测试命令
512并发下16 KB的Ping-Pong纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
512并发下16 KB的Ping-Pong纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
512并发下16 KB的Ping-Pong读写混合测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
512并发下16 KB的Pipeline纯写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:0
512并发下16 KB的Pipeline纯读测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=0:1
512并发下16 KB的Pipeline读写测试。
memtier_benchmark -s $host -p $port -a $password -c 16 -t 32 --pipeline=32 -n 200000 --random-data --randomize --distinct-client-seed -d 16384 --key-maximum=51200000 --key-minimum=1 --key-prefix= --key-pattern=R:R --ratio=1:1
测试结果性能对比如下:
测试场景 | QPS | Avg Latency | p99 Latency |
Ping-Pong 纯写测试 (512 并发,128 Byte) | 85772.17 | 5.96 | 61.18 |
Ping-Pong 纯读测试 (512 并发,128 Byte) | 316719.94 | 1.61 | 5.56 |
Ping-Pong 读写混合测试 (512 并发,128 Byte) | 190028.75 | 2.69 | 15.35 |
Pipeline 纯写测试 (512 并发,128 Byte) | 116429.98 | 140.53 | 2818.04 |
Pipeline 纯读测试 (512 并发,128 Byte) | 356837.30 | 45.58 | 158.71 |
Pipeline 读写混合测试 (512 并发,128 Byte) | 190782.69 | 85.87 | 3031.03 |
Ping-Pong 纯写测试 (512 并发,4096 Byte) | 31389.90 | 16.25 | 175.10 |
Ping-Pong 纯读测试 (512 并发,4096 Byte) | 277324.08 | 1.85 | 8.25 |
Ping-Pong 读写混合测试 (512 并发,4096 Byte) | 70921.68 | 7.22 | 98.81 |
Pipeline 纯写测试 (512 并发,4096 Byte) | 43403.49 | 394.12 | 2916.35 |
Pipeline 纯读测试 (512 并发,4096 Byte) | 393194.35 | 43.03 | 78.33 |
Pipeline 读写混合测试 (512 并发,4096 Byte) | 72161.66 | 58.01 | 811.00 |
Ping-Pong 纯写测试 (512 并发,16 KB) | 9243.16 | 55.36 | 197.63 |
Ping-Pong 纯读测试 (512 并发,16 KB) | 176990.15 | 2.90 | 16.19 |
Ping-Pong 读写混合测试 (512 并发,16 KB) | 18862.27 | 27.13 | 172.03 |
Pipeline 纯写测试 (512 并发,16 KB) | 9800.11 | 1701.05 | 24248.31 |
Pipeline 纯读测试 (512 并发,16 KB) | 180390.39 | 91.59 | 157.69 |
Pipeline 读写混合测试 (512 并发,16 KB) | 20324.56 | 843.81 | 1392.63 |
总结
PolarDB Orca功能沿用了与PolarDB MySQL版一致采用分布式存储,三副本冗余,确保数据无丢失风险。
在Pipeline场景中,PolarDB Orca功能通过大量的聚合优化操作,显著提升了系统吞吐性能。建议您根据实际业务需求,灵活选用Pipeline模式。