TPCC-MySQL Benchmark Test
TPCC-MySQL is a benchmark testing tool developed by Percona.
Download TPCC-MySQL
- Yum install bzr-y
- Bzr branch lp :~ Percona-dev/perconatools/tpcc-mysql
After the download, you can see the tpcc-mysql directory
Go to the src directory under this directory and execute make
In the upper-level directory, you can see that the tpcc_load tpcc_start command is available.
If the following error occurs, it may be MySQL installed in the source code, so its library is not in the default location.
- Error while loading shared libraries: libmysqlclient. so.18: cannot open shared object file: No such file or directory
Creating a soft link can solve this problem.
- Ln-s/home/lihuilin/mysql/lib/libmysqlclient. so.18/usr/lib64/libmysqlclient. so.18
Create a test database and use the following configuration for benchmarking:
- Create database tpcc;
- The MySQL configuration is as follows:
- Max_connections = 3000
- Innodb_buffer_pool_size = 1G
- Innodb_flush_log_at_trx_commit = 1
- Sync_binlog = 1
- Innodb_support_xa = 1
First load the data and execute the SQL statement used to create tables and constraints.
This tool simulates the warehouse system,
You can select the number of initialized warehouses. The larger the number, the larger the data volume.
Initialize 10 Repositories
Start the benchmark test. w indicates the number of warehouses, c indicates the number of concurrency, r indicates the push time, and l indicates the test run time.
- [Root @ mysql1 tpcc-mysql] #. /tpcc_start-h 127.0.0.1-u xx-p xx-d tpcc-w 10-c 200-r 10-l 60-I 10-f report-t trx
- Usage: tpcc_start-h server_host-P port-d database_name-u mysql_user-p mysql_password-w warehouses-c connections-r accept-l running_time-I report_interval-f report_file-t trx_file
The output result of TPCC-MySQL includes five business logics, which constitute the entire transaction processing process of TPCC-MySQL testing. The details are as follows:
New-Order: New Order
Payment: Payment
Order-Status: Order Query
Delivery: Delivery
Stock-Level: Inventory
Predefined variables:
To clearly describe the following, first define some variables to facilitate the calculation and description below. The details are as follows:
Success = number of records successfully executed
Late = number of Execution Delay records
Pre_success = number of records successfully executed last time
Pre_late = number of records that failed the last execution
Based on the variables defined above, calculate the result of the corresponding field and describe the meaning of the corresponding field.
1. Successful transactions within the interval (including successful and delayed transactions): sl = success + late-pre_success-pre_late
2. Delayed transactions in time interval: l = late-pre_late
3. Average response time of the first 90% records (actually 99%) within the time interval: rt90
4. the maximum response time within the time interval: max_rt
View TPCC results
- New Order module payment Module
- Sl (l): rt90 | max_rt 1822 success (0 latency): 90% average response time 1.256 | maximum response time 4.119
- 10,187 9 (6): 4.024 | 9.398, 1822 (0): 1.256 | 4.119, 190 (0): 0.712 | 2.017, 186 (0): 5.227 | 5.929, 191 (0): 18.450 | 24.997
SC: success, lt: late, rt: retry, fl: failure
- <Raw Results>
- [0] SC: 8677 lt: 13 rt: 0 fl: 0 // New Order Number
- [1] SC: 8620 lt: 1 rt: 0 fl: 0 // payment service
- [2] SC: 872 lt: 0 rt: 0 fl: 0 // query service
- [3] SC: 878 lt: 0 rt: 0 fl: 0 // Shipping Service
- [4] SC: 871 lt: 0 rt: 0 fl: 0 // inventory Query
- In 60 sec.
- <Constraint Check> (all must be [OK])
- [Transaction percentage]
- Payment: 43.25% (> = 43.0%) [OK] // The Payment module accounts for 43.25% of the total business.
- Order-Status: 4.37% (> = 4.0%) [OK] // The Order module accounts for 4.37% of the total business
- Delivery: 4.40% (> = 4.0%) [OK] // The Shipping module accounts for 4.40% of the total business.
- Stock-Level: 4.37% (> = 4.0%) [OK] // The inventory module accounts for 4.37% of the total business.
- [Response time (at least 90% passed)] // whether the metric is met
- New-Order: 99.85% [OK]
- Payment: 99.99% [OK]
- Order-Status: 100.00% [OK]
- Delivery: 100.00% [OK]
- Stock-Level: 100.00% [OK]
// The indicators are as follows:
New-Order 5 ms
Payment 5 ms
Order-Status 5 ms
Delivery 80 ms
Stock-Level 20 ms
- <TpmC>
- 8690.000 TpmC // 8690 new orders per minute
Then modify the MySQL configuration and run the same test again.
- Innodb_buffer_pool_size = 512 m
We can see that the performance has decreased significantly.
-------------------------------------- Split line --------------------------------------
Benchmarking Tool-mysql
MySQL benchmarking tool TPCC-MySQL usage notes
MySQL 5.6.7-RC tpcc-mysql Benchmark Test Results
Install MySQL in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL
Build a MySQL Master/Slave service in Ubuntu 14.04
Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: