OceanBase性能测试

327 阅读2分钟

初步接入OceanBase,本文只作为作者记录用途。

RDSOceanBase
单核集群实例(一主二从)
4c16G4c16G
ESSD云盘 PL1ESSD云盘 PL1

1. 准备环境

避免网络产生的延迟,准备了一台和上述两台数据库同属一个内网的 4C16G 的ECS实例。

安装测试工具 sysbench

yum install gcc gcc-c++ autoconf automake make libtool mysql-devel git mysql 
git clone https://github.com/akopytov/sysbench.git 
##从Git中下载Sysbench cd sysbench 
##打开sysbench目录 git checkout 1.0.18 
##切换到sysbench 1.0.18版本 ./autogen.sh 
##运行autogen.sh ./configure --prefix=/usr --mandir=/usr/share/man make 
##编译 make install

参考链接:https://help.aliyun.com/document_detail/151977.html

sysbench和数据库间的ping延迟

实际测试中,OB库的延迟略高于RDS,个人猜测是链路损耗,或者是数据库代理非直连

2. 开始测试

主要测试三种场景,其他场景后续补充

RDS 测试

1、读写混合场景

sysbench线程数:4 
TPS464.93 
QPS9298.63 
RT9.39ms 
压测命令: 
sysbench --db-driver=mysql --mysql-host=rds_host --mysql-port=3306 --mysql-user=xxx --mysql-password=xxx --mysql-db=sbtest --table_size=25000 --tables=100 --events=0 --time=300 --threads=4 --percentile=95 --report-interval=1 /usr/local/sysbench/share/sysbench/oltp_read_write.lua run

2、只读场景

sysbench线程数:4 
TPS586.85
QPS9389.64 
RT7.43ms 
压测命令:
sysbench --db-driver=mysql --mysql-host=rds_host --mysql-port=3306 --mysql-user=xxx --mysql-password=xxx --mysql-db=sbtest --table_size=25000 --tables=100 --events=0 --time=300 --threads=4 --percentile=95 --report-interval=1  /usr/local/sysbench/share/sysbench/oltp_read_only.lua run 

3、只写场景

sysbench线程数:4 
TPS1652.04 
QPS9912.27 
RT2.57ms 
压测命令:
sysbench --db-driver=mysql --mysql-host=rds_host --mysql-port=3306 --mysql-user=xxx --mysql-password=xxx --mysql-db=sbtest --table_size=25000 --tables=100 --events=0 --time=300 --threads=4 --percentile=95 --report-interval=1  /usr/local/sysbench/share/sysbench/oltp_write_only.lua run

OceanBase测试

1、读写混合场景

sysbench线程数:4 
TPS154.53
QPS3090.53 
RT34.95 
压测命令:
sysbench --db-driver=mysql --db-ps-mode=disable --mysql-host=oceanbase.aliyuncs.com --mysql-port=3306 --mysql-user=xxx --mysql-password=xxx --mysql-db=sbtest --table_size=25000 --tables=100 --events=0 --time=300 --threads=4 --percentile=95 --report-interval=1 /usr/local/sysbench/share/sysbench/oltp_read_write.lua run

2、只读场景

sysbench线程数:4 
TPS217.77 
QPS3484.31 
RT25.28ms 
压测命令:
sysbench --db-driver=mysql --db-ps-mode=disable --mysql-host=oceanbase.aliyuncs.com --mysql-port=3306 --mysql-user=xxx --mysql-password=xxx --mysql-db=sbtest --table_size=25000 --tables=100 --events=0 --time=300 --threads=4 --percentile=95 --report-interval=1 /usr/local/sysbench/share/sysbench/oltp_read_only.lua run 

3、只写场景

sysbench线程数:4 
TPS482.30 
QPS2893.80 
RT11.65ms 
压测命令:
sysbench --db-driver=mysql --db-ps-mode=disable --mysql-host=oceanbase.aliyuncs.com --mysql-port=3306 --mysql-user=xxx --mysql-password=xxx --mysql-db=sbtest --table_size=25000 --tables=100 --events=0 --time=300 --threads=4 --percentile=95 --report-interval=1 /usr/local/sysbench/share/sysbench/oltp_write_only.lua run

OB集群属于数据强一致性,相比单核RDS,数据同步占用资源较多,后续准备进行RDS集群的比较。