1. Brief Introduction
The Tpcc-mysql output includes five business logic, five business logic that forms the entire transaction process for tpcc-mysql testing. The following are the specific examples:
New-order: New Order
Payment: Payment
Order-status: Order Enquiry
Delivery: Delivery
Stock-level: Stock
Predefined variables: To be able to clearly explain the following, first define some variables, easy to calculate and explain the following. The following are the specific examples:
Success = number of records executed successfully
Late = number of records executed for delay
pre_success = number of records last executed successfully
Pre_late = number of records last failed to execute
Late definition: Depending on the business, the definition of late is also different, and the boundary values defined by the five business logic respectively for the operation delay are as follows:
New-order 5ms
Payment 5ms
Order-status 5ms
Delivery 80ms
Stock-level 20ms
Calculation:
Based on the variables defined above, the results of the corresponding fields are calculated and the meanings of the corresponding fields are described.
Successful transactions within a time interval (including successful and deferred transactions): Sl=success+late-pre_success-pre_late
Deferred transactions within a time interval: l=late-pre_late
Average response time for the first 90% records (actual 99%) within the time interval: rt90
Maximum response time within the time interval: max_rt
2. compilingTpcc-mysql
Yum-y Install BZR
BZR Branchlp:~percona-dev/perconatools/tpcc-mysql
CD TPCC-MYSQL/SRC
Make
Cd..
After compiling, go back to the parent directory, you can see the tpcc_load, Tpcc_start command .
[email protected] tpcc-mysql]# LL
Total 264
-rw-r--r--1 root root 1621 Dec 1 02:00 add_fkey_idx.sql
-rw-r--r--1 root root 317 Dec 1 02:00 count.sql
-rw-r--r--1 root root 3105 Dec 1 02:00 create_table.sql
-rw-r--r--1 root root 763 Dec 1 02:00 drop_cons.sql
-rw-r--r--1 root root 477 Dec 1 02:00 load.sh
-rw-r--r--1 root root 851 Dec 1 02:00 README
Drwxr-xr-x 2 root root 4096 Dec 1 02:00 schema2
Drwxr-xr-x 5 root root 4096 Dec 1 02:00 scripts
Drwxr-xr-x 2 root root 4096 Dec 1 02:01 src
-rwxr-xr-x 1 root root 64463 Dec 1 02:01 tpcc_load
-rwxr-xr-x 1 root root 165950 Dec 1 02:01 tpcc_start
3. Create a Test library table and import the data
Create DATABASE Thunder;
MySQL Thunder < Create_table.sql
MySQL Thunder < Add_fkey_idx.sql #这步也可以导入数据之后做, but the time is longer
[Email protected] tpcc-mysql]#./tpcc_load-h
*************************************
# # #easy # # TPC-C Data Loader * * *
*************************************
usage:tpcc_load [Server] [DB] [user] [Pass][warehouse]
OR
tpcc_load [Server] [DB] [user] [pass] [warehouse] [part] [MIN_WH][MAX_WH]
* [PART]: 1=items 2=warehouse 3=customer 4=orders
./tpcc_load 127.0.0.1:3306 Thunder Thunderthunder 100
Import data, a warehouse about 70M, you can create the size of the data as needed
4. Start Testing
[Email protected] tpcc-mysql]#./tpcc_start-h
***************************************
# # #easy # # TPC-C Load Generator * * *
***************************************
./tpcc_start:option requires an argument--' h '
Usage:tpcc_start-h server_host-p port-ddatabase_name-u mysql_user-p mysql_password-w warehouses-c Connections-rwa Rmup_time-l running_time-i report_interval-f report_file-t trx_file
-W Specifies how many warehouse, that is, the data size
-c Specifies the number of connections to test
-R Warm-up time, some data will be written to buffer_pool inside
-L Run time
./tpcc_start-h 127.0.0.1-p 3307-dthunder-u thunder-p thunder-w 100-c 100-r 60-l 60-i 10-i report.txt-ttrx.txt
This article is from the "Thundermeng" blog, make sure to keep this source http://thundermeng.blog.51cto.com/9414441/1718326
Tpcc-mysql Benchmark Test