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
相关推荐
OceanBase数据库官方博客3 天前
OAT 初始化时出错?问题可能出在 PAM 配置上|OceanBase 故障排查实践
oceanbase·分布式数据库·故障排查
GottdesKrieges8 天前
OceanBase性能关键参数配置最佳实践
linux·oceanbase
wei_shuo15 天前
高性能数据库架构探索:OceanBase 分布式技术深入解析
分布式·oceanbase·数据库架构
GottdesKrieges15 天前
OceanBase租户扩缩容的三种方法
数据库·oceanbase
枫叶200018 天前
OceanBase数据库-学习笔记4-租户
数据库·笔记·学习·oceanbase
枫叶200020 天前
OceanBase数据库-学习笔记5-用户
数据库·笔记·学习·oceanbase
OceanBase数据库官方博客20 天前
OceanBase 跻身 Forrester 三大领域代表厂商,全面支撑AI场景
人工智能·oceanbase·分布式数据库
GottdesKrieges20 天前
OceanBase数据库磁盘空间管理
java·数据库·oceanbase
枫叶200022 天前
OceanBase数据库-学习笔记1-概论
数据库·笔记·学习·oceanbase
OceanBase数据库官方博客25 天前
向量检索新选择:FastGPT + OceanBase,快速构建RAG
人工智能·oceanbase·分布式数据库·向量数据库·rag