AntDB-单机oracle兼容版本TPCC性能分析(一)

本文介绍了AntDB单机Oracle语法兼容版本在高并发下使用BenchmarkSQL进行TPCC测试时性能下降的情况。通过gprof工具进行性能分析,发现在单进程下,pg语法与oracle语法的TOP10函数差异不大,但多并发场景下可能存在性能瓶颈。文章提供了测试步骤和gprof的使用方法,以及测试结论。
摘要由CSDN通过智能技术生成

背景


AntDB-单机oracle语法兼容版本,高并发下benchmarksql走oracle语法下性能较走pg本身语法下降40%左右。为了诊断软件的性能瓶颈,使用gprof工具在预编译AntDB时打开 –enable-profiling,这个选项会打开gcc的-pg参数,产生可以被gprof用于分析进程的代码。操作数据库后生成的诊断代码默认存放在$PGDATA/gprof目录中,每个进程结束后,都会产生一个子目录,里面会有一个gmon.out文件。

gprof工具简单介绍


gprof是GNU profile工具,可以运行于linux操作系统进行C、C++程序的性能分析,用于程序的性能优化以及程序瓶颈问题的查找和解决。通过分析应用程序运行时产生的“flat profile”,可以得到每个函数的调用次数,每个函数消耗的处理器时间,也可以得到函数的“Call graph 调用关系图”,包括函数调用的层次关系,每个函数调用花费了多少时间。

测试验证


step 1:使用–enable-profiling开关编译AntDB oracle 兼容版本


../adb_sql/configure --prefix=/data/gd/app --with-wal-segsize=64 --with-wal-blocksize=64
 --with-perl --with-python --with-openssl --with-pam --with-ldap --with-libxml --with-libxslt --enable-thread-safety 
 --enable-cassert --enable-debug --enable-depend --disable-cluster --enable-grammar-oracle --enable-profiling CFLAGS=-O0 -ggdb3  
 && gmake install-world-contrib-recurse

备注: 1、–enable-profiling 是打开gprof开关,–disable-cluster –enable-grammar-oracle开关表示编译安装的是单机oracle语法兼容版本;
2、编译安装成功后,设置环境变量

step 2:初始化/配置/启动AntDB单机oracle兼容版本


[gd@intel175 ~]$ initdb -D data_oracle
The files belonging to this database system will be owned by user "gd".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory data_ora ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D data_oracle -l logfile start

设置参数后(postgresql.conf),顺带设置下pg_hba.conf 权限后启动AntDB oracle兼容版本,这里就不再细说。

setp3:初始化benchmarksql测试环境


[zgy@intel176 run]$ less runDatabaseBuild.sh 
#!/bin/sh

if [ $# -lt 1 ] ; then
    echo "usage: $(basename $0) PROPS [OPT VAL [...]]" >&2
    exit 2
fi

PROPS="$1"
shift
if [ ! -f "${PROPS}" ] ; then
    echo "${PROPS}: no such file or directory" >&2
    exit 1
fi
DB="$(grep '^db=' $PROPS | sed -e 's/^db=//')"

BEFORE_LOAD="tableCreates"
AFTER_LOAD="tableCopies indexCreates foreignKeys extraHistID buildFinish"

for step in ${BEFORE_LOAD} ; do
    ./runSQL.sh "${PROPS}" $step
done

#./runLoader.sh "${PROPS}" $*

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值