Home Database Mysql Tutorial MySQL基准测试工具TPCC-MySQL使用笔记_MySQL

MySQL基准测试工具TPCC-MySQL使用笔记_MySQL

Jun 01, 2016 pm 01:06 PM

TPCC是专门针对联机交易处理系统(OLTP系统)的规范,一般情况下我们也把这类系统称为业务处理系统。TPCC-mysql是有percona公司研发,专门转对mysql的基准测试工具,模拟电商业务流程.但是tpcc-mysql的结果并未获得TPC组织的认证,仅作为一个参考数据。

一、下载安装tpcc-mysql

1、安装bzr版本控制工具

#yum install bzr

 tips:如果没有找到安装包,请下搜索下载rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm,安装以后再yum。

2、下载tpcc-mysql源码#bzr branch lp:~percona-dev/perconatools/tpcc-mysql

3、安装

#cd tpcc-mysql/src/

#make

然后会在上层目录生成 tpcc_load tpcc_start两个二进制程序。

二、准备测试

1、创建测试表结构

mysql -uroot -proot -e 'create database tpcc'  //-u -p改成你自己mysql的用户名和密码

mysql -uroot -proot tpcc

mysql -uroot -proot tpcc

2、创建数据

./tpcc_load localhost tpcc root root 100 //最后的数字是代表几个仓库,仓库越大,数据量越大。耗费的时间越长,数据最好模拟你真实的数据量,或者至少大于你的buffer pool。

3、开始测试

./tpcc_start: invalid option -- -

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

 # ./tpcc_start -hlocalhost -d tpcc -u root -p root -w 100 -c 8 -r 10 -l 20

三、输出结果分析

***************************************

*** ###easy### TPC-C Load Generator ***

***************************************

option h with value 'localhost'

option d with value 'tpcc'

option u with value 'root'

option p with value '2012mlnsh'

option w with value '100'

option c with value '8'

option r with value '120'

option l with value '1200'

[server]: localhost

    [port]: 3306

    [DBname]: tpcc

      [user]: root

      [pass]: 2012mlnsh

  [warehouse]: 100

 [connection]: 8

    [rampup]: 120 (sec.)

    [measure]: 1200 (sec.)

RAMP-UP TIME.(120 sec.)

MEASURING START.

10, 1187(0):1.682|2.175, 1187(0):0.336|0.473, 118(0):0.172|0.226, 118(0):1.864|2.122, 119(0):6.953|8.107

  20, 1303(0):1.641|1.877, 1306(0):0.333|0.400, 131(0):0.173|0.203, 130(0):1.895|2.252, 133(0):5.387|5.490

  30, 1471(0):1.677|2.123, 1472(0):0.333|0.394, 148(0):0.160|0.177, 148(0):1.801|2.102, 146(0):5.366|6.069

  40, 1418(0):1.657|2.050, 1415(0):0.338|0.465, 141(0):0.157|0.218, 142(0):1.788|2.140, 142(0):4.965|5.276

  50, 1620(0):1.644|1.937, 1619(0):0.332|0.444, 162(0):0.163|0.201, 161(0):1.934|2.158, 160(0):5.412|5.664

  60, 1702(0):1.735|2.143, 1705(0):0.355|0.420, 170(0):0.167|0.182, 172(0):1.827|2.169, 174(0):5.088|5.214

  70, 1751(0):1.623|2.035, 1748(0):0.343|0.464, 175(0):0.171|0.178, 174(0):1.787|1.798, 174(0):5.598|6.204

  80, 1675(0):1.771|1.999, 1675(0):0.356|0.399, 167(0):0.172|0.180, 167(0):1.828|2.041, 168(0):5.526|6.172

  90, 1805(0):1.723|2.036, 1807(0):0.357|0.458, 181(0):0.176|0.181, 180(0):1.767|2.008, 182(0):5.556|5.796

 100, 1787(0):1.703|2.026, 1784(0):0.359|0.431, 179(0):0.172|0.193, 179(0):1.856|2.027, 177(0):5.429|5.858

 110, 1948(0):1.790|2.087, 1952(0):0.353|0.485, 194(0):0.199|0.207, 195(0):2.057|2.092, 195(0):5.456|5.985

 120, 1981(0):1.710|1.956, 1979(0):0.355|0.407, 198(0):0.173|0.180, 198(0):1.968|2.052, 198(0):5.571|6.180

 130, 1885(0):1.785|2.092, 1884(0):0.365|0.467, 190(0):0.172|0.197, 189(0):2.027|2.096, 188(0):5.451|5.677

 140, 1942(0):1.761|2.035, 1948(0):0.356|0.490, 194(0):0.177|0.217, 194(0):2.081|2.188, 195(0):5.548|5.839

 150, 1992(0):1.742|2.099, 1989(0):0.347|0.380, 199(0):0.207|0.219, 199(0):1.924|2.018, 200(0):5.182|5.547

 160, 1974(0):1.733|2.133, 1977(0):0.352|0.413, 197(0):0.185|0.234, 198(0):2.072|2.156, 196(0):5.751|6.031

 170, 2115(0):1.798|2.085, 2109(0):0.353|0.422, 211(0):0.170|0.223, 210(0):1.939|2.051, 212(0):5.258|5.493

 180, 1840(0):1.791|2.092, 1840(0):0.349|0.455, 185(0):0.179|0.200, 185(0):1.840|1.908, 184(0):5.449|5.508

 190, 2002(0):1.813|2.046, 2000(0):0.356|0.407, 199(0):0.177|0.199, 199(0):2.124|2.178, 200(0):5.569|5.729

 200, 1778(0):1.774|2.185, 1780(0):0.353|0.394, 178(0):0.176|0.205, 179(0):2.036|2.063, 178(0):5.396|5.995

 210, 1943(0):1.738|2.165, 1942(0):0.357|0.450, 195(0):0.168|0.183, 193(0):1.950|2.108, 194(0):5.446|5.839

 220, 1954(0):1.730|2.073, 1958(0):0.353|0.400, 196(0):0.180|0.225, 197(0):1.957|1.973, 196(0):5.573|6.317

 230, 2058(0):1.789|1.930, 2055(0):0.339|0.443, 205(0):0.178|0.206, 205(0):1.918|2.141, 206(0):5.295|5.938

 240, 2106(0):1.786|2.065, 2109(0):0.350|0.414, 210(0):0.175|0.183, 210(0):1.978|2.156, 211(0):5.170|6.782

 250, 2245(0):1.771|2.059, 2242(0):0.346|0.411, 225(0):0.185|0.197, 226(0):1.941|2.070, 224(0):5.450|5.677

 260, 2062(0):1.744|2.150, 2059(0):0.357|0.426, 206(0):0.175|0.229, 205(0):1.949|2.147, 206(0):5.471|6.274

 270, 2026(0):1.739|2.099, 2025(0):0.343|0.389, 202(0):0.166|0.197, 202(0):1.913|2.075, 202(0):5.008|5.394

 280, 1958(0):1.759|2.075, 1950(0):0.356|0.460, 197(0):0.179|0.210, 198(0):1.966|2.043, 197(0):5.336|5.883

 290, 2039(0):1.671|2.043, 2052(0):0.354|0.412, 203(0):0.217|0.230, 204(0):1.890|1.933, 203(0):5.359|5.666

 300, 2158(0):1.824|2.093, 2156(0):0.357|0.429, 217(0):0.180|0.191, 214(0):1.961|2.105, 216(0):5.329|5.864

 310, 2076(0):1.822|2.089, 2081(0):0.356|0.515, 207(0):0.175|0.202, 210(0):2.036|2.148, 209(0):5.348|5.524

 320, 2356(0):1.814|2.081, 2353(0):0.351|0.440, 235(0):0.186|0.216, 235(0):1.988|2.092, 235(0):5.493|5.654

 330, 2326(0):1.803|2.074, 2324(0):0.363|0.418, 233(0):0.188|0.233, 230(0):1.958|2.243, 232(0):5.420|6.108

 340, 10(0):1.122|1.229, 8(0):0.237|0.250, 1(0):0.000|0.096, 0(0):0.000|0.000, 1(0):0.000|3.557

 350, 39(0):1.508|1.627, 40(0):0.321|0.337, 4(0):0.136|0.138, 6(0):1.680|1.800, 5(0):3.644|4.395

 360, 49(0):1.590|1.866, 50(0):0.334|0.335, 5(0):0.137|0.167, 4(0):1.592|1.660, 4(0):4.533|4.654

 370, 44(0):1.725|1.781, 44(0):0.325|0.330, 5(0):0.119|0.152, 6(0):1.475|1.888, 5(0):4.376|4.656

STOPPING THREADS........

//各种状态汇总统计 sc:success,lt:late,rt:retry,fl:failure

  [0] sc:95218  lt:0  rt:0  fl:0  //新订单数

  [1] sc:95217  lt:0  rt:0  fl:0  //支付业务

  [2] sc:9521  lt:0  rt:0  fl:0  //查询业务

  [3] sc:9520  lt:0  rt:0  fl:0  //发货业务

  [4] sc:9525  lt:0  rt:0  fl:0  //库存查询业务

 in 1200 sec.

  [0] sc:95218  lt:0  rt:0  fl:0

  [1] sc:95222  lt:0  rt:0  fl:0

  [2] sc:9521  lt:0  rt:0  fl:0

  [3] sc:9520  lt:0  rt:0  fl:0

  [4] sc:9525  lt:0  rt:0  fl:0

(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: 100.00%  [OK]

        Payment: 100.00%  [OK]

  Order-Status: 100.00%  [OK]

      Delivery: 100.00%  [OK]

    Stock-Level: 100.00%  [OK]

                4760.900 TpmC

内容分析:

10, 1187(0):1.682|2.175, 1187(0):0.336|0.473, 118(0):0.172|0.226, 118(0):1.864|2.122, 119(0):6.953|8.107

10:时间戳,每十秒产生一条数据。

1187(0):1.682|2.175:表示10秒内完成1187笔新订单业务。

1187(0):0.336|0.473: 支付业务,

118(0):1.864|2.122:查询业务,

118(0):0.172|0.226: 发货业务,

119(0):6.953|8.107: 库存查询业务

PS:上面出现了性能抖动,原因是因为我机器一般,操作的库太多,导致buffer_pool脏页过多,刷脏页的时候硬盘资源不足导致的。减少库的数量就可以了,也就是-w参数。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you drop a table in MySQL using the DROP TABLE statement? How do you drop a table in MySQL using the DROP TABLE statement? Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you create indexes on JSON columns? How do you create indexes on JSON columns? Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do you represent relationships using foreign keys? How do you represent relationships using foreign keys? Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

See all articles