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

  • 7
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值