0,安装 bzr 工具(什么是bzr? bzr - easy to use distributed version control system)
root@debian6:~# apt-get install bzr
1,下载并编译 tpcc-mysql 源码
root@debian6:~# bzr branch lp:~percona-dev/perconatools/tpcc-mysql
root@debian6:~# cd tpcc-mysql/src
root@debian6:src# make
cc -w -O2 -g -I. `mysql_config --include` -c load.c
/bin/sh: 1: mysql_config: not found
load.c:11:19: fatal error: stdio.h: No such file or directory
compilation terminated.
make: *** [load.o] Error 1
原来是没有安装mysql_config,安装 libmysqlclient-dev 包就会把mysql_config安装上了。
root@debian6:src# apt-get install libmysqlclient-dev
root@debian6: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_config --include` -c main.c
cc -w -O2 -g -I. `mysql_config --include` -c spt_proc.c
cc -w -O2 -g -I. `mysql_config --include` -c driver.c
cc -w -O2 -g -I. `mysql_config --include` -c sequence.c
cc -w -O2 -g -I. `mysql_config --include` -c rthist.c
cc -w -O2 -g -I. `mysql_config --include` -c neword.c
cc -w -O2 -g -I. `mysql_config --include` -c payment.c
cc -w -O2 -g -I. `mysql_config --include` -c ordstat.c
cc -w -O2 -g -I. `mysql_config --include` -c delivery.c
cc -w -O2 -g -I. `mysql_config --include` -c slev.c
cc main.o spt_proc.o driver.o support.o sequence.o rthist.o neword.o payment.o ordstat.o delivery.o slev.o `mysql_config --libs_r` -lrt -o ../tpcc_start
root@debian6:src# cd ..
root@debian6:tpcc-mysql# ls
add_fkey_idx.sql count.sql create_table.sql drop_cons.sql load.sh README schema2 scripts src tpcc_load tpcc_start
2,编译完成后查看README文件,内有详细的使用说明
root@debian6:tpcc-mysql# cat README
1. Build binaries
* cd scr ; make
( you should have mysql_config available in $PATH)
2. Load data
* create database
mysqladmin create tpcc1000
* create tables
mysql tpcc1000 < create_table.sql
* create indexes and FK ( this step can be done after loading data)
mysql tpcc1000 < add_fkey_idx.sql
* populate data
- simple step
tpcc_load 127.0.0.1:33000 tpcc1000 root "" 1000
|hostname:port| |dbname| |user| |password| |WAREHOUSES|
ref. tpcc_load --help for all options
- load data in parallel
check load.sh script
3. start benchmark
* ./tpcc_start -h127.0.0.1 -P33000 -dtpcc1000 -uroot -w1000 -c32 -r10 -l10800
|hostname| |port| |dbname| |user| |WAREHOUSES| |CONNECTIONS| |WARMUP TIME| |BENCHMARK TIME|
* ref. tpcc_start --help for all options
阅读(3477) | 评论(1) | 转发(0) |