注册
压力测试 - BenchmarkSQL
技术分享/ 文章详情 /

压力测试 - BenchmarkSQL

wild 2024/04/19 2019 2 1

1、测试说明

单机环境下达梦压力测试,学习BenchmarkSQL工具使用,测试结果数据不作为生产环境性能参考
工具版本:benchmarksql-5.1
达梦版本:dm8
系统版本:Kylin Linux Advanced Server V10

2、安装benchmarkSQL5.1

软件依赖

#安装依赖包
yum install gcc glibc-headers gcc-c++ gcc-gfortran readline-devel  libXt-devel pcre-devel libcurl libcurl-devel -y
yum install ncurses ncurses-devel autoconf automake zlib zlib-devel bzip2 bzip2-devel xz-devel -y
yum install java-1.8.0-openjdk ant -y

#编译安装R语言
yum install pango-devel pango libpng-devel cairo cairo-devel -y
tar -zxf R-3.6.3.tar.gz
cd R-3.6.3
./configure && make && make install

#编译安装htop
unzip htop-3.3.0.zip
cd htop-3.3.0
./autogen.sh && ./configure && make && make install

#安装ant
tar -xzvf apache-ant-1.9.16-bin.tar.gz -C /usr/local
vim /etc/profile
export ANT_HOME=/usr/local/apache-ant-1.9.16
export PATH=$PATH:$ANT_HOME/bin
source /etc/profile

#检查安装情况
[root@localhost benchmarksql-master]# java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)
[root@localhost benchmarksql-master]# ant -version 
Apache Ant(TM) version 1.9.16 compiled on July 10 2021
[root@localhost benchmarksql-master]# htop --version
htop 3.3.0
[root@localhost benchmarksql-master]# R --version
R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

配置达梦支持

benchmarksql默认不支持达梦,编译前需要修改两个配置文件

#解压后进入benchmarksql目录
unzip benchmarksql-master.zip

#src/client/jTPcc.java文件中添加如下内容
5fde6e149db83a70abeacfe1c2e54c7.png

#run/funcs.sh文件中添加如下内容
651089608c286a0ce65374458b73934.png

#替换JDBC驱动
mkdir -p /opt/benchmarksql-master/lib/dm
cp /home/dmdba/dmdbms/drivers/jdbc/DmJdbcDriver18.jar
/opt/benchmarksql-master/lib/dm

编译

#使用ant编译BenchmarkSQL
[root@localhost benchmarksql-master]# ant
Buildfile: /opt/benchmarksql-master/build.xml
init:
compile:
    [javac] Compiling 11 source files to /opt/benchmarksql-master/build
dist:
      [jar] Building jar: /opt/benchmarksql-master/dist/BenchmarkSQL-6.devel.jar
BUILD SUCCESSFUL
Total time: 1 second

配置BenchmarkSQL props文件

达梦数据库对应的文件名为dm.porperties
image.png

3、TPC-C 测试

创建测试所需用户和表空间

SQL> create tablespace bmsql datafile '/data/DAMENG/BMSQL01.DBF' size 30720 autoextend on;
SQL> alter tablespace bmsql add datafile '/data/DAMENG/BMSQL02.DBF' size 30720 autoextend on;
SQL> create user bmsql identified by "1234_qwer" default tablespace bmsql;
SQL> grant "PUBLIC","RESOURCE","SOI","VTI" to bmsql;
SQL> alter user bmsql quota unlimited on bmsql;

创建相应的表并加载数据

#使用runDatabaseBuild.sh脚本加载数据
[root@localhost run]# cd /opt/benchmarksql-master/run/
[root@localhost run]# ./runDatabaseBuild.sh dm.properties

image.png

image.png

性能测试

#模拟使用500仓库和200并发,使用runBenchmark.sh脚本进行测试
[root@localhost run]# cd /opt/benchmarksql-master/run/
[root@localhost run]# ./runBenchmark.sh dm.properties 

image.png
image.png

性能测试结果tpm为75887.41
注:压力测试期间,可结合nmon采集系统IO,CPU等压力数据,综合评估性能问题

生成测试报告

#使用generateReport.sh脚本来生成测试报告(需要安装R语言)
[root@localhost run]# ./generateReport.sh my_result_2024-03-08_131009/
Generating my_result_2024-03-08_131009//tpm_nopm.svg ... OK
Generating my_result_2024-03-08_131009//latency.svg ... OK
Generating my_result_2024-03-08_131009//cpu_utilization.svg ... OK
Generating my_result_2024-03-08_131009//dirty_buffers.svg ... OK
Generating my_result_2024-03-08_131009//blk_vda_iops.svg ... OK
Generating my_result_2024-03-08_131009//blk_vda_kbps.svn ... OK
Generating my_result_2024-03-08_131009//net_ens5_iops.svn ... OK
Generating my_result_2024-03-08_131009//net_ens5_kbps.svn ... OK
Generating my_result_2024-03-08_131009//report.html ... OK

[root@scgjjglzx-cs03 run]# ls my_result_2024-03-08_131009
blk_vda_iops.svg  blk_vda_kbps.svg  cpu_utilization.svg  data  dirty_buffers.svg  latency.svg  net_ens5_iops.svg  net_ens5_kbps.svg  report.html  run.properties  tpm_nopm.svg

其中,report.html是生成的测试报告,png文件是报告中包含的图片。

报告内容大致如下:
image.png
image.png
image.png
image.png
image.png
image.png

评论
后发表回复

作者

文章

阅读量

获赞

扫一扫
联系客服