mysql 数据库TPCC测试
创建数据库tpcc,导入测试表格
mysql -h 192.168.0.202 -P15002 -utest -ptest -e "drop database tpcc;"
mysql -h 192.168.0.202 -P15002 -utest -ptest -e "create database tpcc;"
mysql -h192.168.0.202 -P15002 -utest -ptest --database=tpcc < create_table.sql
mysql -h 192.168.0.202 -P15002 -utest -ptest -e "show databases;use tpcc;show tables;"
[root@tdsql1 tpcc_groupshard]# mysql -h 192.168.0.202 -P15002 -utest -ptest -e "create database tpcc;"[root@tdsql1 tpcc_groupshard]# mysql -h192.168.0.202 -P15002 -utest -ptest --database=tpcc < create_table.sql[root@tdsql1 tpcc_groupshard]# mysql -h 192.168.0.202 -P15002 -utest -ptest -e "show databases;use tpcc;show tables;"+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || sys || sysdb || test || tpcc || xa |+--------------------++----------------+| Tables_in_tpcc |+----------------+| customer || district || history || item || new_orders || order_line || orders || stock || warehouse |+----------------+
导入item表
tpcc_load:
Usage: tpcc_load -h server_host -P port -d database_name -u mysql_user -p mysql_password -w warehouses -l part -m min_wh -n max_wh
* [part]: 1=ITEMS 2=WAREHOUSE 3=CUSTOMER 4=ORDERS
./tpcc_load -h 192.168.0.202 -P15002 -d tpcc -utest -ptest -w 2 -l 1 -m 1 -n 100
mysql -h 192.168.0.202 -P15002 -utest -ptest -e "use tpcc;select count(*) from item;"
[root@tdsql1 tpcc_groupshard]# ./tpcc_load -h 192.168.0.202 -P15002 -d tpcc -utest -ptest -w 2 -l 1 -m 1 -n 100**************************************** TPCC-mysql Data Loader ****************************************option h with value '192.168.0.202'option P with value '15002'option d with value 'tpcc'option u with value 'test'option p with value 'test'option w with value '2'option l with value '1'option m with value '1'option n with value '100'<Parameters> [server]: 192.168.0.202 [port]: 15002 [DBname]: tpcc [user]: test [pass]: test [warehouse]: 2 [part(1-4)]: 1 [MIN WH]: 1 [MAX WH]: 100TPCC Data Load Started...Loading Item.................................................. 5000.................................................. 10000.................................................. 15000.................................................. 20000.................................................. 25000.................................................. 30000.................................................. 35000.................................................. 40000.................................................. 45000.................................................. 50000.................................................. 55000.................................................. 60000.................................................. 65000.................................................. 70000.................................................. 75000.................................................. 80000.................................................. 85000.................................................. 90000.................................................. 95000.................................................. 100000Item Done....DATA LOADING COMPLETED SUCCESSFULLY.[root@tdsql1 tpcc_groupshard]# mysql -h 192.168.0.202 -P15002 -utest -ptest -e "use tpcc;select count(*) from item;"+----------+| count(*) |+----------+| 100000 |+----------+[root@tdsql1 tpcc_groupshard]#
导入8张表
./load_data.sh tpcc 192.168.0.202 15002 test test 1 2 2
测试
./tpcc_start -h 192.168.0.202,192.168.0.203 -P 15002 -d tpcc -u test -p test -w 2 -c 2 -r 120 -l 300 -i 1
[root@tdsql1 tpcc_groupshard]# ./tpcc_start -h 192.168.0.202,192.168.0.203 -P 15002 -d tpcc -u test -p test -w 2 -c 2 -r 120 -l 300 -i 1****************************************** ###easy### TPC-C Load Generator ******************************************option h with value '192.168.0.202,192.168.0.203'option P with value '15002'option d with value 'tpcc'option u with value 'test'option p with value 'test'option w with value '2'option c with value '2'option r with value '120'option l with value '300'