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数据库官方博客1 天前
对话Stack Overflow,OceanBase CTO 杨传辉谈分布式数据库的“前世今生”
oceanbase·分布式数据库
OceanBase数据库官方博客1 天前
如何进行OceanBase 运维工具的部署和表性能优化
oceanbase·分布式数据库·运维管理
数据最前线1 天前
再聊OceanBase多副本和高可用
oceanbase
Austindatabases1 个月前
OceanBase & PolarDB 体系分析图 ---一段人生哲理 封箱2024
oceanbase
一名数据库爱好者1 个月前
浅谈OceanBase服务名(SERVICE_NAME)
数据库·oceanbase·dba
一名数据库爱好者1 个月前
OceanBase 读写分离探讨
数据库·oceanbase·dba
一名数据库爱好者1 个月前
浅谈OceanBase旁路导入
大数据·数据库·oceanbase·dba
PawSQL1 个月前
金融级分布式数据库如何优化?PawSQL发布OceanBase专项调优指南
数据库·分布式·sql·oceanbase·pawsql
OceanBase数据库官方博客1 个月前
OceanBase 社区年度之星专访:北控水务纪晓东,社区铁杆开发者
oceanbase·分布式数据库
OceanBase数据库官方博客1 个月前
阳振坤:AI 大模型的基础是数据,AI越发达,数据库价值越大
数据库·人工智能·oceanbase·分布式数据库