【Mysql性能测试之Tpcc-mysql】

TPC(Tracsaction Processing Performance Council) 事务处理性能协会是一个评价大型数据库系统软硬件性能的非盈利的组织,TPC-C是TPC协会制定的,用来测试典型的复杂OLTP系统的性能;Tpcc-MySQL是percona基于tpcc衍生出来的产品,专用于mysql基准测试,其源码放在bazaar上,因此需要先安装bazaar客户端。

Tpcc-mysql是percona基于tpcc衍生出来的产品,专用于mysql基准测试,其源码放在bazaar(Bazaar是一个分布式的版本控制系统,采用 GPL 许可协议,可运行于 Windows、GNU/Linux、UNIX 以及 Mac OS 系统之上。Bazaar 由 Canonical 公司(Ubuntu母公司)赞助)上,因此还需要先安装bazaar客户端。

tpcc_start的用法

Usage: tpcc_start -h server_host -P port -d database_name -u mysql_user -p mysql_password -w warehouses -c connections -r warmup_time -l running_time -i report_interval -f report_file -t trx_file

常用参数说明:

-w 指定仓库数量,也就是要测试几个数据仓库,比如测试干干创建的100个数据仓库

-c 指定并发连接数

-r 指定开始测试前进行warmup的时间,进行预热后,测试效果更好,更准确

-l 指定测试持续时间

-I 指定生成报告间隔时长

-f 指定生成的报告文件名

1)Build binaries

cd src ; 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

  a).simple step tpcc_load -h127.0.0.1 -d tpcc1000 -u root -p "" -w 1000 |hostname:port| |dbname| |user| |password| |WAREHOUSES| ref. tpcc_load --help for all options

  b).load data in parallel check load.sh script

3)Start benchmark

./tpcc_start -h127.0.0.1 -P3306 -dtpcc1000 -uroot -w1000 -c32 -r10 -l10800

|hostname| |port| |dbname| |user| |WAREHOUSES| |CONNECTIONS| |WARMUP TIME| |BENCHMARK TIME|

ref. tpcc_start --help for all options

猜你喜欢

转载自gaojingsong.iteye.com/blog/2381283