mysql performance testing tools --tpcc-mysql

1, the installation tool
Download source, extract the installation
# gunzip tpcc-mysql-src.tgz
# tar xf tpcc-mysql-src.tar
# cd tpcc-mysql/src
# make
After the tool generates two binary tpcc_load (initialization data providing function) and tpcc_start (stress test)
 
2, tpcc-mysql business logic
 
New-Order: New Order, a complete order transaction, involving almost all the tables
Payment: payments, mainly corresponds orders, history table
Order-Status: order status, mainly corresponds orders, order_line table
Delivery: Delivery, mainly corresponds to the table order_line
Stock-Level: inventory, mainly corresponds stock table
Customer: The main customer correspondence table
Area: mainly corresponds district table
Goods: The main item correspondence table
Warehouse: mainly corresponds warehouse table
 
3, tpcc test preparation, initialize the database
Enter tpcc-mysql directory
# Mysqladmin -uroot -pxxx create tpcc # create test databases (xxx is your Mysql password, tpcc for the database name you created)
# Mysql -uroot -pxxx -f tpcc <create_table.sql # Create a table of test
# Mysql -uroot -pxxx tpcc <add_fkey_idx.sql # FK and create index
 
4, loading data
#./tpcc_load  --help
./tpcc_load [server] [bd] [user] [password] [warehouse]
                  The name of the database server name of the user name and password warehouse number
E.g:
#./tpcc_load localhost tpcc root xxx 150  
The real test, the database warehouse generally less than 100, if the configuration ssd, recommends a minimum of not less than 1000
 
5, test
#./tpcc_start --help
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] - > out1
 
Each parameter is used as follows:
-h server_host: server name
-P port: port number, the default is 3306
-d database_name: database name
-u mysql_user: Username
-p mysql_password: Password
-w warehouses: the number of warehouses
-c connections: the number of threads, the default is 1
-r warmup_time: warm-up time, unit: s, default is 10s, warm-up is to load data into memory. (The real test is recommended warm-up time is not less than 5 minutes)
-l running_time: test time, unit: s, default is 20s
-i report_interval: generate a report interval specified length (the real test of not less than 30min)
-f report_file: Test results output file (usually named xxx.log)
-t trx: the output file
-> out1: out1 console output into a file in
E.g:
./tpcc_start -h localhost -p 3306 -d tpcc -u root -p xxx -w 150 -c 12 -r 300 -l 360 -f test0.log -t test1.log - >test0.out
 
-F report output files
Many data is set in the following example:
// 0 1.273 0 for timestamp, 1.273 represented within 0-10s first pen new business orders took 1.273s
1.752 0 // 0 for timestamp, 1.752 represented within 0-10s second pen new business orders took 1.752s
0 3.768
0 3.399
0 1.584
... (to space constraints, omitted a lot of data here, the same below)
1.489 10 // 10 indicates timestamp, 1.489 in the 10-20s represent the first new order business takes 1.489s
10 1.635
 
-t trx output file:
t_num: 10 finish: 1364890011 61758711 start: 1364890011 27467602
t_num: 0 finish: 1364890011 63430248 start: 1364890011 24673279
t_num: 7 finish: 1364890011 73803144 start: 1364890011 28447105
10 shows the result of 10 is output from the connect (-c parameter), the latter two start and finish data represents the end time of order and the actually transmitted time units are s / ns, finish-start time refers to the occupancy cpu time, a large part of the order completion time is consumed on another disk IO processing of.
 
E.g:
- some basic information about the current round of tpcc pressure measured
***************************************
*** ###easy### TPC-C Load Generator ***
***************************************
option h with value 'localhost'         -- 主机
option d with value 'tpcc' - Database
option u with value 'root'              -- 账号
option p with value 'yourpassword'      -- 密码
option w with value '150' - the number of warehouse
option c with value '12' - the number of concurrent threads
option r with value '300' - preheating data length (in seconds)
option l with value '3600' - pressure measurement duration (sec)
non-option ARGV-elements: -
<Parameters>
     [server]: localhost
     [port]: 3306
     [DBname]: tpcc
       [user]: root
       [pass]: xxx
  [warehouse]: 150
[connection]: 12
     [rampup]: 300 (sec.)
    [measure]: 3600 (sec.)
- preheating is completed, begin measuring pressure
RAMP-UP TIME.(300 sec.)
- every 10 seconds a pressure test data output
MEASURING START.
  10, 435(0):3.322|6.846, 435(0):0.672|1.661, 44(0):0.386|0.439, 43(0):4.017|4.847, 44(0):11.076|11.907
  20, 418(0):3.334|3.482, 416(0):0.669|0.728, 41(0):0.355|0.390, 41(0):3.796|4.356, 41(0):10.580|10.781
  30, 410(0):3.332|4.708, 412(0):0.656|1.661, 41(0):0.304|0.308, 42(0):3.844|3.926, 42(0):10.542|10.646
...
  3580, 445(0):3.277|3.402, 447(0):0.658|0.765, 44(0):0.326|0.404, 45(0):3.856|3.950, 44(0):10.805|10.899
  3590, 388(0):3.352|3.589, 391(0):0.697|0.795, 39(0):0.320|0.330, 39(0):3.826|4.009, 39(0):10.638|10.844
  3600, 407(0):3.256|3.390, 405(0):0.676|0.746, 41(0):0.331|0.339, 41(0):3.904|3.910, 41(0):10.625|10.653
- separated by a comma, a total of six
- a first column, the first N times 10 seconds
- the second column, the number of new orders for pressure measurement of the success of the implementation of (the number of delayed pressure test execution): 90% response time transaction | maximum response time of the current round of testing, the number of new orders Affairs also considered the total number of active transactions index
- the third column, the number of successful execution of payment services (delayed execution count): 90% response time transaction | maximum response time of the current round of testing
- The fourth column, the results of operations of order status, several of the above meaning behind
- the fifth column, the result of shipping logistics services, several of the above meaning behind
- the sixth column, inventory storage business results, several of the above meaning behind
- Pressure measurement end
STOPPING THREADS............
- The first results of the statistical
<Raw Results>
  [0] sc: 144136 lt: 5 rt: 0 fl: 0 - New-Order, Order new business success (Success, abbreviated sc) frequency delay (LATE, abbreviated lt) number of retries (the retry, abbreviated rt) the number of failures (failure, abbreviated fl) number
  [1] sc: 144148 lt: 0 rt: 0 fl: 0 - Payment, payment services statistics, other ibid
  [2] sc: 14416 lt: 0 rt: 0 fl: 0 - Order-Status, order status business statistics, other ibid
  [3] sc: 14416 lt: 0 rt: 0 fl: 0 - Delivery, shipping business statistics, other ibid
  [4] sc: 14416 lt: 0 rt: 0 fl: 0 - Stock-Level, business inventory statistics, other ibid.
in 3600 sec.
- Second statistical results, other ibid
<Raw Results2(sum ver.)>
  [0] sc:144147  lt:5  rt:0  fl:0
  [1] sc:144154  lt:0  rt:0  fl:0
  [2] sc:14416  lt:0  rt:0  fl:0
  [3] sc:14416  lt:0  rt:0  fl:0
  [4] sc:14416  lt:0  rt:0  fl:0
<Constraint Check> (all must be [OK]) - The following are the results of all the business logic must job OK
[transaction percentage]
        Payment: 43.48% (> = 43.0%) [OK] - the number of successful payment (in the above statistics sc + lt) must be greater than 43.0%, otherwise the result is the NG, instead of the OK
   Order-Status: 4.35% (> = 4.0%) [OK] - the order status, other supra
       Delivery: 4.35% (> = 4.0%) [OK] - shipment, other supra
    Stock-Level: 4.35% (> = 4.0%) [OK] - stock, other supra
[Response time (at least 90% passed)] - response time consuming index must exceed 90% by the job
      New-Order: 100.00% [OK] - Processed next few indicators all in response to 100%
        Payment: 100.00%  [OK]
   Order-Status: 100.00%  [OK]
       Delivery: 100.00%  [OK]
    Stock-Level: 100.00%  [OK]
<TpmC>
                 2402.350 TpmC - TpmC result value (transactions per minute, which value is a new order number of transactions in the first divided by the total number of statistics takes minutes, for example, in the present embodiment is: 144136/60 = 2402.350)

Guess you like

Origin www.cnblogs.com/hupoykitty/p/11612869.html