|
Tpcc-mysql is percona based tpcc derived dedicated to mysql benchmark products
First, install
rpm -Uvh http://dl.Fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install bzr
bzr branch lp: ~ percona-dev / perconatools / tpcc-mysql
See README
[Root @ localhost tpcc-mysql] # cat README
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 indexes and FK (this step can be done after loading data)
mysql tpcc1000
* 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
Second, prepare for work
A script online: tpcc_load_parallel.sh
Here WAREHOUSE = 10
#! / Bin / bash
# Configration
MYSQL = mysql
TPCCLOAD =. / Tpcc_load
TABLESQL =. / Create_table.sql
CONSTRAINTSQL =. / Add_fkey_idx.sql
DEGREE = `getconf _NPROCESSORS_ONLN`
SERVER = 192.168.1.104
DATABASE = tpcc
USER = root
PASS = 123456
WAREHOUSE = 10
# Load
set -e
$ MYSQL -h $ SERVER -u $ USER -p $ PASS -e "DROP DATABASE IF EXISTS $ DATABASE"
$ MYSQL -h $ SERVER -u $ USER -p $ PASS -e "CREATE DATABASE $ DATABASE"
$ MYSQL -h $ SERVER -u $ USER -p $ PASS $ DATABASE <$ TABLESQL
$ MYSQL -h $ SERVER -u $ USER -p $ PASS $ DATABASE <$ CONSTRAINTSQL
/usr/local/src/tpcc-mysql/tpcc_load_parallel.sh [FORMAT = unix] [TYPE = SH] [POS = 1,1] [1%] 09/01/16 - 23:26
done
if [$ STATUS -ne 0]; then
exit $ STATUS
fi
PIDLIST = ()
fi
done
for PID in $ {PIDLIST [@]}; do
wait $ PID
if [$ -ne 0?]; then
STATUS = 1
fi
done
if [$ STATUS -eq 0]; then
echo 'Completed.'
fi
exit $ STATUS
Third, start the test
./tpcc_start -h192.168.1.104 -dtpcc -uroot -p123456 -w10 -c16 -r10 -l1200> /tmp/512m-tpcc-data.log
./tpcc_start -h192.168.1.104 -dtpcc -uroot -p123456 -w10 -c16 -r10 -l1200> /tmp/1g-tpcc-data.log
./tpcc_start -h192.168.1.104 -dtpcc -uroot -p123456 -w10 -c16 -r10 -l1200> /tmp/2g-tpcc-data.log
./tpcc_start -h192.168.1.104 -dtpcc -uroot -p123456 -w10 -c8 -r10 -l1200> /tmp/8c-tpcc-data.log
./tpcc_start -h192.168.1.104 -dtpcc -uroot -p123456 -w10 -c16 -r10 -l1200> /tmp/16c-tpcc-data.log
./tpcc_start -h192.168.1.104 -dtpcc -uroot -p123456 -w10 -c64 -r10 -l1200> /tmp/64c-tpcc-data.log
-d test library
-u username
-p password
How many data warehouse -w use
-c Number of concurrent tests
-r preheat seconds
-l long run test
Interpretation of test results
***************************************
*** ### Easy ### TPC-C Load Generator ***
***************************************
option h with value '192.168.1.104'
option d with value 'tpcc'
option u with value 'root'
option p with value '123456'
option w with value '20' // Warehouse
option c with value '16' // number of concurrent threads
When the option r with value '10' long preheating //
option l with value '1200'
[Server]: 192.168.1.104
[Port]: 3306
[DBname]: tpcc
[User]: root
[Pass]: 123456
[Warehouse]: 20
[Connection]: 16
[Rampup]: 10 (sec.)
[Measure]: 1200 (sec.)
RAMP-UP TIME. (10 sec.)
// End of warm, begin measuring pressure
MEASURING START.
// Output once every 10 seconds pressure measurement data
10, 0 (0): 17.297 | 29.366, 2 (1): 6.077 | 6.390, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 3.968, 0 (0): 0.000 | 0.000
20, 2 (2): 19.999 | 40.895, 3 (2): 5.218 | 10.209, 0 (0): 0.000 | 0.000, 1 (0): 0.000 | 53.658, 1 (1): 0.000 | 140.858
30, 0 (0): 0.000 | 0.000, 1 (1): 0.000 | 5.888, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 0.000
40, 4 (4): 19.999 | 25.264, 4 (3): 9.853 | 13.864, 0 (0): 0.000 | 0.000, 1 (0): 0.000 | 3.219, 0 (0): 0.000 | 0.000
50, 5 (5): 19.999 | 40.184, 4 (2): 6.046 | 7.648, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 0.000
60, 0 (0): 0.000 | 0.000, 1 (0): 0.000 | 3.568, 1 (1): 0.000 | 24.226, 1 (0): 0.000 | 1.637, 0 (0): 0.000 | 0.000
......
1170, 4 (4): 19.437 | 25.995, 4 (3): 7.417 | 9.241, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 0.000
1180, 6 (6): 19.999 | 26.409, 9 (2): 5.568 | 8.834, 1 (0): 0.000 | 1.762, 1 (0): 0.000 | 36.276, 1 (1): 0.000 | 86.459
1190, 2 (2): 11.617 | 12.754, 2 (2): 5.420 | 8.147, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 0.000, 0 (0): 0.000 | 0.000
1200, 2 (2): 16.664 | 22.551, 1 (0): 0.000 | 1.486, 0 (0): 0.000 | 0.000, 1 (0): 0.000 | 30.834, 1 (1): 0.000 | 256.143
// Separated by commas, a total of six
// The first column, the first N times 10 seconds
// Second column, the number of times (the number of delays in the implementation of the pressure test) new orders for the successful implementation of the pressure test: 90% of the response time of the transaction | maximum response time of the current round of testing, the number of new orders for the transaction is also considered an effective total number of transactions index
// Third column, the number of successful payment transaction execution (postponed execution count): 90% of the response time of the transaction | maximum response time of the current round of testing
// The fourth column, the results of operations of order status, followed by several of the same meaning as above
// Fifth column, logistics and shipping business results, followed by a few meaning as above
// The sixth column, inventory warehousing business results, followed by a few meaning as above
- Pressure measurement completion
STOPPING THREADS ................
[0] sc: 4 lt: 243 rt: 546999 fl: 275 // New-Order, new orders for business success (success, abbreviated sc) the number of delay (late, abbreviated lt) the number of retries (retry, abbreviated rt) the number of failures (failure, abbreviated fl) times
[1] sc: 144 lt: 92 rt: 565412 fl: 281 // Payment, payment business statistics, other ibid.
[2] sc: 24 lt: 3 rt: 50802 fl: 26 // Order-Status, order status business statistics, other ibid.
[3] sc: 52 lt: 0 rt: 0 fl: 0 // Delivery, shipping business statistics, other ibid.
[4] sc: 0 lt: 27 rt: 50788 fl: 26 // Stock-Level, business inventory statistics, other ibid.
in 1200 sec.
[0] sc: 4 lt: 243 rt: 547120 fl: 275
[1] sc: 144 lt: 92 rt: 565566 fl: 281
[2] sc: 24 lt: 3 rt: 50802 fl: 26
[3] sc: 52 lt: 0 rt: 0 fl: 0
[4] sc: 0 lt: 27 rt: 50788 fl: 26
(all must be [OK]) // The following are the results of all the business logic must be OK job
[Transaction percentage]
Payment: 40.07% (> = 43.0%) [NG] * // successful payment frequency (above statistical results sc + lt) must be greater than 43.0%, otherwise the result is NG, rather than OK
Order-Status: 4.58% (> = 4.0%) [OK] // Order
Delivery: 8.83% (> = 4.0%) [OK] // Ship
Stock-Level: 4.58% (> = 4.0%) [OK] // stock
[Response time (at least 90% passed)] // Processed response index must exceed 90% by the job
New-Order: 1.62% [NG] *
Payment: 61.02% [NG] *
Order-Status: 88.89% [NG] *
Delivery: 100.00% [OK]
Stock-Level: 0.00% [NG] *
12.350 TpmC - TpmC result value (transactions per minute)
Fourth, the use gnuplot drawing
Drawing script
./tpcc_analyze.sh 512m-tpcc-data.log> 512m-tpcc-data.data
./tpcc_analyze.sh 1g-tpcc-data.log> 1g-tpcc-data.data
./tpcc_analyze.sh 2g-tpcc-data.log> 2g-tpcc-data.data
paste 512m-tpcc-data.data 1g-tpcc-data.data 2g-tpcc-data.data> tpcc-data.data
./tpcc-graph.sh tpcc-data.data tpcc.jpg
tpcc_analyze.sh
#! / Bin / bash
TIMESLOT = 1
if [-n "$ 2"]
then
TIMESLOT = $ 2
echo "Defined $ 2"
fi
cat $ 1 | grep -v HY000 | grep -v payment | grep -v neword | \
awk -v timeslot = $ TIMESLOT 'BEGIN {FS = "[, ():]"; s = 0; cntr = 0; aggr = 0} \
/ MEASURING START / {s = 1} / STOPPING THREADS / {s = 0} / 0 / {if (s == 1) {cntr ++; aggr + = $ 2;} \
if (cntr == timeslot) {printf ( "% d% 3f \ n", $ 1, $ 5); cntr = 0; aggr = 0}} '
tpcc_graph.sh
#! / Bin / bash
gnuplot << EOP
set style line 1 lt 1 lw 3
set style line 2 lt 5 lw 3
set style line 3 lt 7 lw 3
set terminal png size 960,480
set grid x y
set xlabel "Time (sec)"
set ylabel "Transactions"
set output "$ 2"
plot "$ 1" using 1: 2 title "PS 5.1.56 buffer pool 512MM" ls 1 with lines, \
"$ 1" using 3: 4 title "PS 5.1.56 buffer pool 1g" ls 2 with lines, \
"$ 1" using 3: 6 title "PS 5.1.56 buffer pool 2g" ls 3 with lines axes x1y1
EOP
Possible errors
Could not find / open font when opening font "arial", using internal non-scalable font
export GDFONTPATH = / usr / share / fonts / liberation
export GNUPLOT_DEFAULT_GDFONT = LiberationSans-Regular
source ~ / .bashrc |
|
|
|