Oceanbase 使用OBD 一键性能测试(Sysbench,TPCC,TPCH)

该篇博客基于 oceanbase 官网 (DBA从入门到实践)一课 做的实操笔记

首先需要了解TPCC 模拟工具,这一工具在之前的博客有提到。

PG POC-TPCC测试部署与使用-CSDN博客

实操环境: oceanbase 单节点 all-in-one部署环境,也就是obd demo

这里我们都用obd一键测试,比较简单,如果obd不满足需求可以选择手动测试的方式。

sysbench:

1.创建资源单元

CREATE RESOURCE UNIT unit1
   max_cpu = 1,
   min_cpu = 1,
   memory_size = 2684354560,
   max_iops = 10000,
   min_iops = 10000,
   iops_weight = 1,
   log_disk_size = 2684354560;

2.创建资源池

CREATE RESOURCE POOL pool1
   UNIT = 'unit1',
   UNIT_NUM = 1,
   ZONE_LIST = ('zone1');

3.创建租户

CREATE TENANT IF NOT EXISTS tenant1
   charset='utf8mb4',
   comment 'mysql tenant/instance',
   primary_zone='RANDOM',
   resource_pool_list = ('pool1') set ob_tcp_invited_nodes = '%';

4.添加一脚本 ob_sysbench.sh

#!/bin/bash
export ENABLE_PROTOCOL_OB20=0

echo "run oltp_read_only test"
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_only.lua --table-size=1000000 --threads=32 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_only.lua --table-size=1000000 --threads=64 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_only.lua --table-size=1000000 --threads=128 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_only.lua --table-size=1000000 --threads=256 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_only.lua --table-size=1000000 --threads=512 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_only.lua --table-size=1000000 --threads=1024 --rand-type=uniform

echo "run oltp_write_only test"
obd test sysbench demo --tenant=tenant1 --script-name=oltp_write_only.lua --table-size=1000000 --threads=32 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_write_only.lua --table-size=1000000 --threads=64 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_write_only.lua --table-size=1000000 --threads=128 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_write_only.lua --table-size=1000000 --threads=256 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_write_only.lua --table-size=1000000 --threads=512 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_write_only.lua --table-size=1000000 --threads=1024 --rand-type=uniform

echo "run oltp_read_write test"
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_write.lua --table-size=1000000 --threads=32 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_write.lua --table-size=1000000 --threads=64 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_write.lua --table-size=1000000 --threads=128 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_write.lua --table-size=1000000 --threads=256 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_write.lua --table-size=1000000 --threads=512 --rand-type=uniform
obd test sysbench demo --tenant=tenant1 --script-name=oltp_read_write.lua --table-size=1000000 --threads=1024 --rand-type=uniform

5.安装依赖执行脚本

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
sudo yum install ob-sysbench
./ob_sysbench.sh

6.观察效果

可以看到已经在跑了,具体的参数还需要根据不同的结构来调整。

另外如果出现了大量超时报错可以调整sql超时时间和事务超时时间参数来解决。

这两个参数为ob_query_timeout 和 ob_trx_timeout ,调整为合适的大小即可。

tpcc:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
sudo yum install obtpcc java
obd test tpcc demo --tenant=tenant1 --warehouses 10  --run-mins 1

tpch:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
sudo yum install obtpch
sudo ln -s /usr/tpc-h-tools/tpc-h-tools/ /usr/local/
obd test tpch demo  --tenant=tenant1 -s 1 --remote-tbl-dir=/tmp/tpch1
相关推荐
Dnui_King3 小时前
Oceanbase Restore Point实践
oceanbase
OceanBase数据库官方博客4 小时前
OceanBase 运维管理工具 OCP 4.x 升级:聚焦高可用、易用性及可观测性
oceanbase·分布式数据库·数据库运维
OceanBase数据库官方博客4 小时前
关于OceanBase 多模一体化的浅析
oceanbase·分布式数据库·kv·多模数据库
OceanBase数据库官方博客2 天前
打造高效实时数仓,从Hive到OceanBase的经验分享
oceanbase·分布式数据库·实时数仓
OceanBase数据库官方博客2 天前
OpenStack × OceanBase: 打造高可用可扩展的基础设施平台
开源·openstack·oceanbase·分布式数据库·生态工具
OceanBase数据库官方博客3 天前
关于OceanBase MySQL 模式中全局索引 global index 的常见问题
mysql·oceanbase·分布式数据库·全局索引
广益-简放3 天前
写在OceanBase开源三周年
开源·oceanbase
标准形与二次型7 天前
windows环境安装OceanBase数据库并创建表、插入数据
数据库·oceanbase
Dnui_King10 天前
oceanbase 常用视图查询记录
数据库·sql·oceanbase
爬树的小蚂蚁10 天前
OceanBase 的ODP OBproxy 的记录
oceanbase