一、tpcc安装步骤
github地址:Percona-Lab/tpcc-mysql
1.下载github代码
git clone https://github.com/Percona-Lab/tpcc-mysql
2.编译
cd /tpcc-mysql/src/
,执行make
时报错:
cc load.o support.o `mysql_config --libs_r` -lrt -o ../tpcc_load
/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
make: *** [../tpcc_load] Error 1
3.解决办法
查看mysql有关的库的所在位置
ldconfig -v | grep mysql
ldconfig: Can‘t stat /libx32: No such file or directory
ldconfig: Path `/usr/lib‘ given more than once
ldconfig: Path `/usr/lib64‘ given more than once
ldconfig: Can‘t stat /usr/libx32: No such file or directory
ldconfig: Cannot stat /lib64/libmysqlclient.so: No such file or directory
ldconfig: Cannot stat /lib64/libmysqlclient_r.so: No such file or directory
/usr/lib64/mysql:
libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
建立软连接
ln -s /usr/lib64/mysql/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.16
将软连接所在目录加入到/etc/ld.so.conf
ldconfig -v
4.再次执行make
make
cc load.o support.o `mysql_config --libs_r` -lrt -o ../tpcc_load
cc -w -O3 -g -I. `mysql_config --include` -c main.c
cc -w -O3 -g -I. `mysql_config --include` -c spt_proc.c
cc -w -O3 -g -I. `mysql_config --include` -c driver.c
cc -w -O3 -g -I. `mysql_config --include` -c sequence.c
cc -w -O3 -g -I. `mysql_config --include` -c rthist.c
cc -w -O3 -g -I. `mysql_config --include` -c sb_percentile.c
cc -w -O3 -g -I. `mysql_config --include` -c neword.c
cc -w -O3 -g -I. `mysql_config --include` -c payment.c
cc -w -O3 -g -I. `mysql_config --include` -c ordstat.c
cc -w -O3 -g -I. `mysql_config --include` -c delivery.c
cc -w -O3 -g -I. `mysql_config --include` -c slev.c
cc main.o spt_proc.o driver.o support.o sequence.o rthist.o sb_percentile.o neword.o payment.o ordstat.o delivery.o slev.o `mysql_config --libs_r` -lrt -o ../tpcc_start
5.创建表,添加外键,导入数据
mysql -S /tmp/mysql.sock57 tpcc1000 < create_table.sql
mysql -S /tmp/mysql.sock57 tpcc1000 < add_fkey_idx.sql
./tpcc_load -h127.0.0.1 -d tpcc1000 -u root -p 123456 -P 3357 -w 1
6.测试
./tpcc_start -h 127.0.0.1 -d tpcc1000 -u root -p 123456 -P 3357 -w 1 -c 8 -r 1 -l 300 -i 10
成功安装tpcc进行测试
7.测试结果
***************************************
*** ###easy### TPC-C Load Generator ***
***************************************
option h with value ‘127.0.0.1‘
option d with value ‘tpcc1000‘
option u with value ‘root‘
option p with value ‘123456‘
option P with value ‘3357‘
option w with value ‘1‘
option c with value ‘8‘
option r with value ‘1‘
option l with value ‘300‘
option i with value ‘10‘
<Parameters>
[server]: 127.0.0.1
[port]: 3357
[DBname]: tpcc1000
[user]: root
[pass]: 123456
[warehouse]: 1
[connection]: 8
[rampup]: 1 (sec.)
[measure]: 300 (sec.)
RAMP-UP TIME.(1 sec.)
MEASURING START.
10, trx: 2780, 95%: 15.259, 99%: 20.560, max_rt: 29.903, 2782|49.403, 278|5.356, 278|54.216, 279|33.305
20, trx: 2740, 95%: 15.610, 99%: 22.237, max_rt: 26.838, 2741|42.043, 274|3.172, 273|56.119, 274|30.069
30, trx: 2752, 95%: 15.540, 99%: 20.394, max_rt: 40.833, 2753|46.781, 276|5.086, 276|52.688, 274|39.058
40, trx: 2719, 95%: 16.220, 99%: 22.330, max_rt: 29.662, 2715|43.119, 271|5.624, 271|57.254, 273|34.797
50, trx: 2723, 95%: 16.317, 99%: 21.874, max_rt: 34.494, 2729|60.430, 272|6.337, 273|54.506, 272|37.481
60, trx: 2657, 95%: 16.162, 99%: 21.375, max_rt: 33.559, 2653|42.309, 266|4.601, 266|50.138, 266|36.991
70, trx: 2497, 95%: 17.418, 99%: 24.546, max_rt: 38.325, 2495|48.634, 249|5.618, 249|62.138, 249|41.972
80, trx: 2637, 95%: 16.618, 99%: 22.491, max_rt: 44.810, 2643|42.428, 265|5.958, 264|59.691, 264|37.457
90, trx: 2607, 95%: 16.225, 99%: 22.579, max_rt: 41.577, 2605|51.410, 260|8.760, 261|65.225, 261|35.246
100, trx: 2661, 95%: 16.147, 99%: 22.091, max_rt: 40.987, 2658|51.999, 266|5.355, 265|53.984, 266|35.072
110, trx: 2675, 95%: 16.337, 99%: 22.025, max_rt: 35.592, 2676|43.256, 268|5.013, 268|67.305, 268|43.565
120, trx: 2644, 95%: 15.728, 99%: 20.913, max_rt: 36.715, 2644|46.135, 264|3.295, 264|76.894, 264|43.980
130, trx: 2548, 95%: 18.104, 99%: 23.979, max_rt: 44.107, 2545|53.809, 255|5.371, 255|70.437, 255|46.719
140, trx: 2637, 95%: 16.763, 99%: 23.384, max_rt: 40.556, 2642|42.983, 263|6.227, 264|63.731, 263|36.412
150, trx: 2740, 95%: 15.457, 99%: 21.795, max_rt: 40.741, 2737|51.558, 275|9.168, 274|65.856, 274|40.401
160, trx: 2664, 95%: 17.195, 99%: 23.743, max_rt: 46.275, 2665|56.300, 266|7.299, 266|62.583, 266|42.234
170, trx: 2700, 95%: 15.200, 99%: 21.146, max_rt: 44.281, 2698|54.921, 270|4.684, 270|60.794, 271|42.978
180, trx: 2763, 95%: 15.770, 99%: 21.210, max_rt: 33.758, 2766|45.543, 277|12.026, 277|66.090, 277|42.125
190, trx: 2718, 95%: 15.770, 99%: 21.933, max_rt: 34.500, 2718|46.190, 271|6.237, 271|74.116, 271|40.988
200, trx: 2688, 95%: 16.470, 99%: 21.854, max_rt: 42.735, 2685|46.281, 269|5.002, 269|69.820, 268|40.370
210, trx: 2634, 95%: 16.708, 99%: 23.016, max_rt: 46.236, 2637|45.855, 263|7.824, 264|75.833, 264|46.677
220, trx: 2624, 95%: 16.386, 99%: 22.518, max_rt: 56.155, 2625|53.808, 263|4.125, 262|63.170, 263|51.835
230, trx: 2752, 95%: 15.893, 99%: 21.672, max_rt: 38.077, 2751|57.344, 275|8.106, 275|55.405, 274|38.248
240, trx: 2743, 95%: 15.287, 99%: 21.633, max_rt: 43.058, 2743|56.763, 275|4.467, 275|60.561, 275|32.099
250, trx: 2742, 95%: 15.064, 99%: 21.510, max_rt: 36.075, 2740|49.778, 273|3.333, 274|51.832, 274|43.163
260, trx: 2732, 95%: 15.827, 99%: 21.678, max_rt: 38.828, 2733|52.394, 274|6.593, 273|53.889, 273|38.924
270, trx: 2671, 95%: 15.526, 99%: 21.286, max_rt: 63.298, 2671|57.177, 267|3.295, 267|68.415, 268|32.968
280, trx: 2660, 95%: 16.733, 99%: 21.952, max_rt: 37.036, 2661|59.210, 266|3.727, 266|72.445, 265|33.218
290, trx: 2515, 95%: 16.663, 99%: 24.363, max_rt: 39.232, 2513|63.435, 251|7.164, 252|59.757, 251|45.004
300, trx: 2553, 95%: 16.869, 99%: 21.620, max_rt: 35.406, 2557|58.913, 256|5.851, 255|68.171, 255|39.846
STOPPING THREADS........
<Raw Results>
[0] sc:8964 lt:71212 rt:0 fl:0 avg_rt: 8.8 (5)
[1] sc:624 lt:79557 rt:0 fl:0 avg_rt: 16.1 (5)
[2] sc:7984 lt:34 rt:0 fl:0 avg_rt: 0.9 (5)
[3] sc:8017 lt:0 rt:0 fl:0 avg_rt: 31.8 (80)
[4] sc:5876 lt:2141 rt:0 fl:0 avg_rt: 18.0 (20)
in 300 sec.
<Raw Results2(sum ver.)>
[0] sc:8964 lt:71212 rt:0 fl:0
[1] sc:624 lt:79557 rt:0 fl:0
[2] sc:7984 lt:34 rt:0 fl:0
[3] sc:8017 lt:0 rt:0 fl:0
[4] sc:5876 lt:2141 rt:0 fl:0
<Constraint Check> (all must be [OK])
[transaction percentage]
Payment: 43.48% (>=43.0%) [OK]
Order-Status: 4.35% (>= 4.0%) [OK]
Delivery: 4.35% (>= 4.0%) [OK]
Stock-Level: 4.35% (>= 4.0%) [OK]
[response time (at least 90% passed)]
New-Order: 11.18% [NG] *
Payment: 0.78% [NG] *
Order-Status: 99.58% [OK]
Delivery: 100.00% [OK]
Stock-Level: 73.29% [NG] *
<TpmC>
16035.200 TpmC