-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_mariadb_tpcc.sh
More file actions
executable file
·111 lines (94 loc) · 3.04 KB
/
Copy pathrun_mariadb_tpcc.sh
File metadata and controls
executable file
·111 lines (94 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/sh
export PATH=$PATH:.:
LD_LIBRARY_PATH=/lib64/mariadb:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
## Set variables for the run
storagetype="Storage not specified"
Usercount="10 20 40 80 100"
whc="500"
DBRESTARTUP="n"
Testname="HDB_tpcc_mariadb"
usage()
{
echo "Usage:
run_mssql_tpcc.sh [-h] [-u users] [-t runlength] [-w warehouse count] [-s storage type]
Usage:
-h help
-u # of users (Default - "10 20 40 80 100")
-t runlength in minutes (Default - 15 minuteS)
-w warehouse count (Default - 500 )
-s storage type ( Default - "Storage not speficied" )
Examples:
run_mariadb_tpcc.sh -u "10 20 30"
Do runs with 10, 20 and 30 users
run_mariadb_tpcc.sh -s "nvme"
Do a 10 user, 500 warehouse, 15 minute run with storage type as "nvme"
run_mariadb_tpcc.sh -w 1000 -u "10 20 40 80 100" -s "iscsi"
Do a 1000 warehouse run with 10 20 40 80 and 100 users and storage type specified as iscsi
"
}
while [ $# -gt 0 ]
do
case $1 in
-h) usage;
exit;
;;
-w) whc=$2
shift 2
;;
-u) Usercount=$2
shift 2
;;
-s) storagetype=$2
shift 2
;;
-t) RUNLENGTH=$2
shift 2
;;
*) usage;
exit;
;;
esac
done
mkdir -p results
if [ -z "${benchmark_results_dir}" ]
then
benchmark_results_dir=`pwd`"/results"
fi
if [ -z "${benchmark_run_dir}" ]
then
benchmark_run_dir=`pwd`"/results"
fi
#echo ${storagetype}
#echo ${Usercount}
#echo ${benchmark_results_dir}
#echo ${whc}
## Collecting system information
benchmark_name="Hammerdb-tpcc"
benchmark_ver="HammerDB-3.2"
hostnm=`hostname -f`
hostip=`hostname -i`
numcpu=`nproc`
totmem=`cat /proc/meminfo |grep "MemTotal:" | awk '{print $2}'`
krel=`uname -r` ## Kernel
# Set Host IP and Warehouse Count in the tcl file
sed -i "s/^diset tpcc mysql_count_ware.*/diset tpcc mysql_count_ware ${whc}/" runtest_mariadb.tcl
echo "StartTime,EndTime,Hostname,Kernel,Database,DBVer,Cpus,Memory,StorageType,Users,Tpm" > user-benchmark-result.csv
mariaver=`mysql -V |awk '{print $5}' | sed -e 's/,//'`
for uc in ${Usercount}
do
echo "Restarting Database before each run"
systemctl restart mariadb.service
starttime=`date +%Y.%m.%d.%T`
echo "Run with ${uc} users"
sed -i "s/^vuset.*/vuset vu ${uc}/" runtest_mariadb.tcl
./hammerdbcli auto runtest_mariadb.tcl > test_mariadb_${Testname}_${uc}.out 2>&1
endtime=`date +%Y.%m.%d.%T`
grep RESULT test_mariadb_${Testname}_${uc}.out
tpm=`grep TPM test_mariadb_${Testname}_${uc}.out | awk '{print $7}'`
echo "\"${starttime}\",\"${endtime}\",\"${hostnm}\",\"${krel}\",\"Mariadb\",\"${mariaver}\",\"${numcpu}\",\"${totmem}\",\"${storagetype}\",\"${uc}\",\"${tpm}\"" >> user-benchmark-result.csv
cp user-benchmark-result.csv $benchmark_results_dir
cp /etc/my.cnf $benchmark_results_dir
cp test_mariadb_${Testname}_${uc}.out $benchmark_results_dir
done
systemctl stop mariadb.service