TPC(Tracsaction Processing Performance Council) 事务处理性能协会是一个评价大型数据库系统软硬件性能的非盈利的组织,TPC-C是TPC协会制定的,用来测试典型的复杂OLTP系统的性能。Tpcc-mysql是percona基于tpcc衍生出来的产品,专用于mysql基准测试,其源码放在bazaar上,因此需要先安装bazaar客户端。
项目地址:
一 下载工具
首先,安装bzr客户端
# yum -y install bzr
下载tpcc-mysql过程中遇到的问题
# bzr branch lp:~percona-dev/perconatools/tpcc-mysql
bzr: ERROR: Couldn't import bzrlib and dependencies.
Please check the directory containing bzrlib is on your PYTHONPATH.
Traceback (most recent call last):
File "/usr/bin/bzr", line 102, in
import bzrlibpython
ImportError: No module named bzrlib
提示找不到 bzrlib模块,因为调用Python,建议升级到2.6版本
解决方法:
# find / -name bzrlib -print
/usr/lib64/python2.4/site-packages/bzrlib
定义环境变量:
# export PYTHONPATH=/usr/lib64/python2.4/site-packages
再次下载ok.
#bzr branch lp:~percona-dev/perconatools/tpcc-mysql
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
Branched 48 revision(s).
bzr: warning: some compiled extensions could not be loaded; see
二 编译安装
进入源码目录
#cd tpcc-mysql/src
#make
cc -w -O2 -g -I. `mysql_config --include` -c load.c
cc -w -O2 -g -I. `mysql_config --include` -c support.c
cc load.o support.o `mysql_config --libs_r` -lrt -o ../tpcc_load
cc -w -O2 -g -I. `mysql_con