sysbench手动测试OceanBase v4.2.4集群

news/2025/3/10 18:13:38/

环境:
1、ocp(sysbench节点)
192.192.103.128
2、ob集群1-1-1

observer 192.192.103.125、192.192.103.126、192.192.103.127,primary_zone:random

haproxy 192.192.103.125、192.192.103.126、192.192.103.127

一、安装sysbench(128)
源码安装:
JDK:建议使用 1.8u131 及以上版本
#yum install automake libtool autoconf make gcc -y
#tar zxvf sysbench-1.0.20.tar.gz
#cd sysbench-1.0.20
#./autogen.sh
#./configure
#make &&make install
#cd /sysbench/sysbench-1.0.20/src/lua
[root@ocp lua]# ls -ltr
total 124
-rwxrwxr-x 1 root root  2118 Apr 24  2020 select_random_ranges.lua
-rwxrwxr-x 1 root root  1919 Apr 24  2020 select_random_points.lua
-rwxrwxr-x 1 root root  1440 Apr 24  2020 oltp_write_only.lua
-rwxrwxr-x 1 root root  1127 Apr 24  2020 oltp_update_non_index.lua
-rwxrwxr-x 1 root root  1118 Apr 24  2020 oltp_update_index.lua
-rwxrwxr-x 1 root root  1824 Apr 24  2020 oltp_read_write.lua
-rwxrwxr-x 1 root root  1649 Apr 24  2020 oltp_read_only.lua
-rwxrwxr-x 1 root root  1265 Apr 24  2020 oltp_point_select.lua
-rwxrwxr-x 1 root root  2415 Apr 24  2020 oltp_insert.lua
-rwxrwxr-x 1 root root  1290 Apr 24  2020 oltp_delete.lua
-rw-rw-r-- 1 root root 14369 Apr 24  2020 oltp_common.lua
-rw-rw-r-- 1 root root  1219 Apr 24  2020 Makefile.am
-rwxrwxr-x 1 root root  1452 Apr 24  2020 bulk_insert.lua
-rw-r--r-- 1 root root 25401 Mar  6 10:53 Makefile.in
-rw-r--r-- 1 root root 25950 Mar  6 10:54 Makefile
drwxrwxr-x 2 root root  4096 Mar  6 10:55 internal

二、安装obclient(128)
rpm -ivh obclient-2.2.7-1.el7.x86_64.rpm

三、为 sysbench 测试创建 database:bench1(ob集群,任一节点登录即可)
$ obclient -h192.192.103.125 -P2883 -uroot@mytant#obs_test_cluster -D oceanbase -A -p
MySQL [oceanbase]> create database bench1;
MySQL [oceanbase]> show databases;
+--------------------+
| Database           |
+--------------------+
| bench1             |
| information_schema |
| mydb               |
| mysql              |
| oceanbase          |
| test               |
+--------------------+
6 rows in set (0.01 sec)
MySQL [oceanbase]>  grant all on *.* to root;

四、手动测试
#ob集群临时关闭一些参数:

MySQL [oceanbase]> altersystem SET enable_sql_audit=false;
MySQL [oceanbase]> alter system SET enable_perf_event=false;
MySQL [oceanbase]> alter system SET syslog_level='PERF';
MySQL [oceanbase]> alter system set enable_record_trace_log=false;
#测试过程(都是在OCP 128远程执行)

本次测试通过haproxy集群连接测试,端口2883。
1.初始化环境
#sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  ./oltp_read_write.lua cleanup
2.导入2张表,每张表包含1000条数据量。
sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  ./oltp_read_write.lua prepare
3.执行每一个case,执行30s
sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  ./oltp_read_write.lua run


sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  ./oltp_point_select.lua run


sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  ./oltp_read_only.lua run


sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  --rand-type=uniform ./oltp_read_write.lua run


sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  ./oltp_insert.lua run


sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  ./oltp_update_non_index.lua run


sysbench --mysql-host=192.192.103.125 --mysql-port=2883 --mysql-user=root@mytant#obs_test_cluster --mysql-db=bench1 --mysql-password=Root_1234 --report-interval=3 --time=30 --threads=4 --db-ps-mode=disable --percentile=99 --auto_inc=on --tables=2 --mysql-ignore-errors=1062 --table_size=1000  ./oltp_write_only.lua run


4、测试结果
分布式场景( primary zone = 'RANDOM' ),这里只举一例(read_write),用来说明各统计信息的含义。
SQL statistics:
    queries performed:
        read:                            3374
        write:                           964
        other:                           482
        total:                           4820
    transactions:                        241    (8.02 per sec.)
    queries:                             4820   (160.35 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          30.0572s
    total number of events:              241

Latency (ms):
         min:                                  126.70
         avg:                                  498.80
         max:                                 1546.92
         99th percentile:                     1149.76
         sum:                               120210.83

Threads fairness:
    events (avg/stddev):           60.2500/3.56
    execution time (avg/stddev):   30.0527/0.00


http://www.ppmy.cn/news/1578148.html

相关文章

uniapp版本加密货币行情应用

uniapp版本加密货币行情应用 项目概述 这是一个使用uniapp开发的鸿蒙原生应用,提供加密货币的实时行情查询功能。本应用旨在为用户提供便捷、实时的加密货币市场信息,帮助用户随时了解市场动态,做出明智的投资决策。 应用采用轻量级设计&a…

使用QT + 文件IO + 鼠标拖拽事件 + 线程 ,实现大文件的传输

第一题、使用qss&#xff0c;通过线程&#xff0c;使进度条自己动起来 mythread.h #ifndef MYTHREAD_H #define MYTHREAD_H#include <QObject> #include <QThread> #include <QDebug>class mythread : public QThread {Q_OBJECT public:mythread(QObject* …

Xenium数据分析 | 下机数据读取

今天我们将下载10x官方人肺癌FFPE样本Xenium5k下机数据&#xff0c;使用python的spatialdata库&#xff0c;演示如何进行Xenium单个样本/多样本数据读取&#xff0c;以及简单绘图功能展示。 1. 示例数据下载&#xff1a; 数据下载地址: https://www.10xgenomics.com/datasets…

关于Springboot 应配置外移和Maven个性化打包一些做法

期望达到的效果是每次更新服务器端应用只需要更新主程序jar 依赖jar单独分离。配置文件独立存放于文件夹内&#xff0c;更新程序并不会覆盖已有的配置信息。 一、配置外移 1、开发环境外移 做法&#xff1a;在项目同级或者上级创建config文件夹放置配置文件&#xff0c;具体m…

Windows控制台函数:控制台读取输入函数ReadConsoleA()

目录 什么是 ReadConsoleA&#xff1f; 它长什么样&#xff1f; 怎么用它&#xff1f; 它跟 std::cin 有什么不一样&#xff1f; 注意事项 什么是 ReadConsoleA&#xff1f; ReadConsoleA 是一个 Windows API 函数&#xff0c;用来从控制台读取用户输入。想象一下&#…

Java进阶:Docker

1. Docker概述 1.1. Docker简介 Docker 是一个开源的应用容器引擎&#xff0c;基于 Go 语言开发。Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中&#xff0c;然后发布到任何流行的 Linux 机器上&#xff0c;也可以实现虚拟化。容器是完全使用沙箱…

DR和BDR的选举规则

在 OSPF&#xff08;开放最短路径优先&#xff09;协议中&#xff0c;DR&#xff08;Designated Router&#xff0c;指定路由器&#xff09; 和 BDR&#xff08;Backup Designated Router&#xff0c;备份指定路由器&#xff09; 的选举是为了在广播型网络&#xff08;如以太网…

游戏引擎学习第146天

音高变化使得对齐读取变得不可能&#xff0c;我们可以支持循环声音了。 我们今天的目标是完成之前一段时间所做的音频代码。这个项目并不依赖任何引擎或库&#xff0c;而是一个教育项目&#xff0c;目的是展示从头到尾运行一个游戏所需要的全部代码。无论你对什么方面感兴趣&a…