tpcc mysql 基准测试_使用tpcc-mysql 对mysql进行基准测试

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值