TPCC-MYSQL 应用测试

TPCC-MySQL 基于TPCC协议的MySQL 实现

TPCC简介:

TPC-C is an on-line transaction processing benchmark,TPC-C simulates a complete computing environment where a population of users executes transactions against a database. The benchmark is centered around the principal activities (transactions) of an order-entry environment. These transactions include entering and delivering orders, recording payments, checking the status of orders, and monitoring the level of stock at the warehouses. While the benchmark portrays the activity of a wholesale supplier, TPC-C is not limited to the activity of any particular business segment, but, rather represents any industry that must manage, sell, or distribute a product or service.

TPC-C involves a mix of five concurrent transactions of different types and complexity either executed on-line or queued for deferred execution. The database is comprised of nine types of tables with a wide range of record and population sizes. TPC-C is measured in transactions per minute (tpmC).

结构如下:

结果值tpmC是代表每分钟事务处理的数量,一般仓库设置为40-100个,为cpu bound,400-1000个是为了测试io bound,40以下无论事务多少,锁竞争情况也不太容易发生。

本地环境:

CPU:Intel(R) Xeon(R) CPU           X3430  @ 2.40GHz

Mem:16G

HDD: SATA 500G

1、安装:

bzr branch lp:~percona-dev/perconatools/tpcc-mysql (需首先安装bzr)

接下来就是编译, cd tpcc-mysql 直接make 后就OK了,会在当前目录下生成tpcc_load、tpcc_start 两个运行程序,主要也就是用这两个程序

2、使用方法简介:

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 

接下来,生成测试数据:

#./tpcc_load 127.0.0.1:3307 tpcc1000 root "modular" 1000 (测试时视仓库数量而定,运行时间会比较久)

进行测试:

tpcc_start Usage:

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 仓库数量
-c 并发连接数
-r 测试前warmup的时间,测试前预热时间
-l 测试持续时间
-I 生成报告间隔时长
-f 生成的报告文件名

运行命令如下:

#./tpcc_start -h127.0.0.1 -P3307 -dtpcc1000 -uroot -pmodular -w1000 -c32 -r10 -l10800

运行结果:

[[email protected] tpcc-mysql]# more benchmark.log
***************************************
*** ###easy### TPC-C Load Generator ***
***************************************
option h with value ‘127.0.0.1‘
option P with value ‘3307‘
option d with value ‘tpcc1000‘
option u with value ‘root‘
option p with value ‘modular‘
option w with value ‘1000‘
option c with value ‘32‘
option r with value ‘10‘
option l with value ‘10800‘
<Parameters>
[server]: 127.0.0.1
[port]: 3307
[DBname]: tpcc1000
[user]: root
[pass]: modular
[warehouse]: 1000
[connection]: 32
[rampup]: 10 (sec.)
[measure]: 10800 (sec.)

RAMP-UP TIME.(10 sec.)

MEASURING START.

10, 7(0):1.766|1.806, 12(0):0.593|0.608, 1(0):0.263|0.350, 1(0):0.000|3.034, 1(0):0.000|9.013
20, 11(0):3.350|3.740, 10(0):0.546|0.615, 2(0):0.209|0.266, 1(0):0.000|3.533, 1(0):0.000|8.559
30, 10(0):3.436|3.700, 19(0):0.563|0.566, 1(0):0.000|0.310, 0(0):0.000|0.000, 1(0):0.000|8.306
40, 9(0):3.260|3.530, 6(0):0.493|0.608, 1(0):0.000|0.317, 1(0):0.000|3.060, 2(0):7.629|9.541
50, 17(0):2.897|2.999, 16(0):0.564|0.596, 1(0):0.000|0.293, 1(0):0.000|3.475, 1(0):0.000|8.859
60, 10(0):3.104|3.228, 9(0):0.526|0.582, 1(0):0.000|0.316, 1(0):0.000|3.360, 0(0):0.000|0.000
70, 11(0):2.762|2.808, 12(0):0.555|0.558, 1(0):0.000|0.268, 1(0):0.000|3.528, 2(0):7.387|9.906
80, 13(0):3.198|3.629, 11(0):0.558|0.559, 2(0):0.268|0.317, 0(0):0.000|0.000, 1(0):0.000|8.610
90, 17(0):3.025|3.133, 15(0):0.543|0.568, 1(0):0.000|0.267, 1(0):0.000|3.314, 0(0):0.000|0.000
100, 5(0):2.502|2.696, 10(0):0.460|0.497, 1(0):0.000|0.275, 1(0):0.000|3.484, 3(0):8.376|8.442
110, 17(0):2.722|3.080, 14(0):0.579|0.581, 1(0):0.000|0.303, 1(0):0.000|3.523, 0(0):0.000|0.000
120, 7(0):3.137|3.217, 8(0):0.514|0.516, 2(0):0.285|0.305, 2(0):3.085|3.598, 2(0):8.044|8.239
130, 19(0):2.918|3.080, 16(0):0.505|0.553, 1(0):0.000|0.226, 2(0):3.341|3.453, 1(0):0.000|8.897
140, 4(0):1.582|1.721, 8(0):0.515|0.540, 1(0):0.000|0.223, 1(0):0.000|3.445, 2(0):8.408|9.736
150, 17(0):2.977|3.155, 12(0):0.571|0.579, 1(0):0.000|0.246, 0(0):0.000|0.000, 1(0):0.000|8.718
160, 13(0):3.016|3.411, 17(0):0.587|0.599, 1(0):0.000|0.220, 2(0):3.017|3.100, 1(0):0.000|8.659
。。。。。。。。。。。。。。。。。。。。

10800, 27(0):2.830|2.832, 25(0):0.516|0.556, 2(0):0.205|0.255, 3(0):2.903|3.353, 3(0):9.740|9.754

STOPPING THREADS................................

<Raw Results>
[0] sc:23728 lt:0 rt:0 fl:0
[1] sc:23727 lt:0 rt:0 fl:0
[2] sc:2374 lt:0 rt:0 fl:0
[3] sc:2372 lt:0 rt:0 fl:0
[4] sc:2365 lt:0 rt:0 fl:0
in 10800 sec.

<Raw Results2(sum ver.)>
[0] sc:23736 lt:0 rt:0 fl:0
[1] sc:23738 lt:0 rt:0 fl:0
[2] sc:2374 lt:0 rt:0 fl:0
[3] sc:2372 lt:0 rt:0 fl:0
[4] sc:2365 lt:0 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.33% (>= 4.0%) [OK]
[response time (at least 90% passed)]
New-Order: 100.00% [OK]
Payment: 100.00% [OK]
Order-Status: 100.00% [OK]
Delivery: 100.00% [OK]
Stock-Level: 100.00% [OK]

<TpmC>
131.822 TpmC

时间: 2024-08-26 14:45:22

TPCC-MYSQL 应用测试的相关文章

MySQL压测工具--TPCC安装,测试

今天我们来讲一下MySQL的压力测试工具,目前我接触到的主要有两种压力测试工具:TPCC,Sysbench,前者只适合MySQL数据库OLTP压力测试,而Sysbench功能就比较广泛,可以测试OS的CPU,Memory,IO,以及多种关系型数据库,如MySQL,PostgreSQL; 这篇博客主要讲解Tpcc 安装,测试. 简介 TPC-C是专门针对联机交易处理系统(OLTP系统)的规范,一般情况下我们也把这类系统称为业务处理系统: tpcc-mysql是percona基于TPC-C衍生出来的

mysql基础测试

测试原因   为什么需要做性能测试 模拟比当前系统更高的负载,找出性能瓶颈 重现线上异常 测试不同硬件软件配置 规划未来的业务增长 测试分类   性能测试的分类 设备层的测试 业务层的测试 数据库层的测试   设备层的测试 关注哪些指标 服务器,磁盘性能 磁盘坏块率 服务器寿命 业务层测试 针对业务进行测试 数据库层的测试 什么情况下要做Mysql的测试 测试不同的Mysql分之版本 测试不同的mysql版本 测试不同的mysql参数搭配 mysql测试分类 CPU Bound --全内存的测试

使用sysbench对mysql压力测试

使用sysbench对mysql压力测试 sysbench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况.关于这个项目的详细介绍请看:https://github.com/akopytov/sysbench .它主要包括以下几种方式的测试: cpu性能 磁盘io性能 调度程序性能 内存分配及传输速度 POSIX线程性能 数据库性能(OLTP基准测试) sysbench的数据库OLTP测试支持MySQL.PostgreSQL.Oracle,目前主要用

在window cmd中设置字符集后,mysql的测试

之前测试过,在centos下,所有字符集全部设为utf8,可以同时满足命令行和网页的需求. 在windows下,由于默认字符集为gbk,所以在命令行操作mysql时,需要设置set character_set_client = gbk; 今天发现,其实是要设置set character_set_results = gbk;即可,其它均为utf8或gbk都行. 另外尝试改变windows字符集,cmd下chcp 65001切换到utf8,但这好像是临时的,由于这次安装的wamp,用的自带的终端,c

mysql主从复制测试

mysql主从复制测试: 1. 配置主服务器:在主库上面添加复制账号GRANT REPLICATION SLAVE on *.* to 'mark'@'%' identified by 'mark' WITH GRANT OPTION; 在my.ini配置文件中添加配置:[mysqld]# 服务的唯一标识符server-id=1# 开启二进制日志,默认路径在data/下log-bin=mysql-bin # 二进制文件的格式 binlog_format=row 查看状态: SHOW MASTER

mysql sysbench测试安装及命令

一.安装sysbench 1.软件版本sysbench-0.4.12.7 2.编译安装 1)编译配置 # ./configure --with-mysql-includes=/opt/mysql/include/ --with-mysql-libs=/opt/mysql/lib/ 2)编译 #make .... .... /bin/sh ../libtool --tag=CC   --mode=link gcc -pthread -g -O2      -o sysbench sysbench.

mysql压力测试

1,使用 mysqlslap  进行压力测试 mysqlslap  --defaults-file=/etc/my.cnf --concurrency=200 --iterations=1 --number-int-cols=1 --auto-generate-sql --auto-generate-sql-load-type=write --engine=myisam,innodb --number-of-queries=200 -S/home/mysql/mysql.sock  --debu

MySQL压力测试工具

工具名称:mysqlha_sysbench.sh 工具用途:用于MySQL压力测试  (2种功能:填充数据&&测试数据) 工具参数: options: -P 需要测试的端口-D 需要测试的db名字-H 需要测试的host-S 填充&&测试 表的数据量,default 100w-C 填充&&测试 表的数量, default 1-T prepare and run ,prepare is 制造数据 run is 开始测试 ,default run-O on an

MySQL Study之--MySQL压力测试工具mysqlslap

MySQL Study之--MySQL压力测试工具mysqlslap 一.Mysqlslap介绍 mysqlslap是MySQL5.1之后自带的benchmark基准测试工具,类似Apache Bench负载产生工具,生成schema,装载数据,执行benckmark和查询数据,语法简单,灵活,容易使用.该工具可以模拟多个客户端同时并发的向服务器发出查询更新,给出了性能测试数据而且提供了多种引擎的性能比较.mysqlslap为mysql性能优化前后提供了直观的验证依据,笔者建议系统运维人员应该掌

PHP+MySQL:测试连接+基本DB操作

PHP使用MySQL,从连接.创建.到结果显示 1 <?php 2 //连接MySQL测试 3 $db = mysql_connect("localhost","root","wenwen"); 4 if (!$db) 5 { 6 die('Could not connect: ' . mysql_error()); 7 } 8 else 9 { 10 echo "connect success!"; 11 } 12 1