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
相关推荐
Edingbrugh.南空1 天前
Flink OceanBase CDC 环境配置与验证
大数据·flink·oceanbase
丶意冷1 天前
mybatisPlus分页方言设置错误问题 mybatisPlus对于Oceanbase的Oracle租户分页识别错误
java·数据库·oracle·oceanbase
.Eyes13 天前
OBCP第二章 OceanBase 存储引擎高级技术学习笔记
笔记·学习·oceanbase
Tapdata 钛铂数据15 天前
信创 CDC 实战|国产数据库的数据高速通道:OceanBase 实时入仓 StarRocks
数据库·oceanbase
Dnui_King21 天前
OceanBase (DBA)一面面经
数据库·oceanbase·dba
OceanBase数据库官方博客23 天前
OceanBase v4.3.5 特性解读:通过OSS WORM特性进行备份归档
oceanbase·分布式数据库·存储
OceanBase数据库官方博客23 天前
常用的OceanBase调优配置参数
oceanbase·分布式数据库·参数
OceanBase数据库官方博客1 个月前
蚂蚁集团 CTO 何征宇:AGI时代,海量数据带来的质变|OceanBase 开发者大会实录
人工智能·oceanbase·分布式数据库·开发者大会
数据最前线1 个月前
OceanBase 开发者大会,拥抱 Data*AI 战略,构建 AI 数据底座
人工智能·oceanbase