2
MYSQLADMIN="./bin/mysqladmin"
4
MYSQLD_SAFE="./bin/mysqld_safe"
7
PROJECT_HOME="${HOME}/Projects/MariaDB";
11
function kill_mysqld {
12
./bin/mysqladmin --user=root shutdown 0
19
function start_mysqld {
20
./bin/mysqld_safe $MYSQLD_OPTIONS &
24
while [ $j -le $TIMEOUT ]
26
$MYSQLADMIN $MYSQLADMIN_OPTIONS ping > /dev/null 2>&1
37
if [ $STARTED != 0 ]; then
38
echo '[ERROR]: Start of mysqld failed.'
39
echo ' Please check your error log.'
48
echo "--- Running Scenario1 ---"
50
#1) Start the MySQL 5.5.13 server
51
cd $PROJECT_HOME/mysql-5.5.13-linux2.6-x86_64
52
# ./bin/mysqld_safe --defaults-file=../scripts/config/mysql_my.cnf --user=root &
53
MYSQLD_OPTIONS="--defaults-file=$PROJECT_HOME/scripts/config/mysql_my.cnf --user=root"
57
#2)Execute the perl script for the first test with MySQL 5.5.13 and engine InnoDB
58
cd $PROJECT_HOME/scripts/
59
perl bench_script.pl --max-time=$MAX_TIME \
60
--dbname=mysql_5_5_13 \
62
--results-output-dir=./Scenario1 \
63
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
64
--mysql-table-engine=innodb \
68
cd $PROJECT_HOME/mysql-5.5.13-linux2.6-x86_64/
70
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64
71
MYSQLD_OPTIONS="--defaults-file=$PROJECT_HOME/scripts/config/mariadb_my.cnf";
74
#4) Execute the perl script for the second test with MariaDB and engine InnoDB
75
cd $PROJECT_HOME/scripts/
76
perl bench_script.pl --max-time=$MAX_TIME \
77
--dbname=mariadb_5_2_7 \
79
--results-output-dir=./Scenario1 \
80
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
81
--mysql-table-engine=innodb \
84
#5) Execute the perl script for the second test with MariaDB and engine PBXT
85
cd $PROJECT_HOME/scripts/
86
perl bench_script.pl --max-time=$MAX_TIME \
87
--dbname=mariadb_5_2_7 \
89
--results-output-dir=./Scenario1 \
90
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
91
--mysql-table-engine=pbxt \
94
#6) Stop the server after the tests are complete
95
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/
98
#7) Run the gnuplot script to generate a graphic
99
cd $PROJECT_HOME/scripts/
100
gnuplot $PROJECT_HOME/scripts/gnuplot_scenario1.txt
102
echo "Scenario 1 complete"
108
echo "--- Running Scenario2 ---"
110
#1) Copy oltp_aria.lua to the other default workloads in sysbench
111
cd $PROJECT_HOME/scripts/
112
cp oltp_aria.lua ../sysbench/sysbench/tests/db/
114
#2) Start the MySQL 5.5.13 server
115
cd $PROJECT_HOME/mysql-5.5.13-linux2.6-x86_64
116
MYSQLD_OPTIONS="--defaults-file=../scripts/config/mysql_my.cnf --user=root"
120
#3) Execute the perl script with MySQL 5.5.13 and MyISAM storage engine
121
cd $PROJECT_HOME/scripts/
122
perl bench_script.pl --max-time=$MAX_TIME \
123
--dbname=mysql_5_5_13 \
124
--keyword=scenario2 \
125
--results-output-dir=./Scenario2 \
126
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
127
--mysql-table-engine=myisam \
128
--workload=oltp_aria.lua \
131
#4) Switch to MariaDB 5.2.7
132
cd $PROJECT_HOME/mysql-5.5.13-linux2.6-x86_64/
134
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64
135
MYSQLD_OPTIONS="--defaults-file=../scripts/config/mariadb_my.cnf"
138
#5) Execute the perl script with MariaDB 5.2.7 and Aria storage engine
139
cd $PROJECT_HOME/scripts/
140
perl bench_script.pl --max-time=$MAX_TIME \
141
--dbname=mariadb_5_2_7 \
142
--keyword=scenario2 \
143
--results-output-dir=./Scenario2 \
144
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
145
--mysql-table-engine=aria \
146
--workload=oltp_aria.lua \
149
#6) Stop the server after the tests are complete
150
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/
153
#7) Run the gnuplot script to generate a graphic
154
cd $PROJECT_HOME/scripts/
155
gnuplot gnuplot_scenario2.txt
157
echo "Scenario 2 complete"
162
echo "--- Running Scenario3 ---"
163
#1) Create a folder on the SSD drive
165
#mkdir vlado_bench_ssd
166
#2) Copy the installed data directory to SSD
167
#cp -r $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/data/ /media/ssd_tmp/vlado_bench_ssd/
169
#3) Start the mysqld process for MariaDB 5.2.7 with both data and binlog on HDD
170
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64
172
MYSQLD_OPTIONS="--defaults-file=../scripts/config/mariadb_my.cnf --log-basename=hdd_binlog --log-bin=1 --datadir=./data"
175
#4) Execute the perl script for the first test with MariaDB + XtraDB with both data and binlog on HDD
176
cd $PROJECT_HOME/scripts/
177
perl bench_script.pl --max-time=$MAX_TIME \
178
--dbname=mariadb_5_2_7 \
180
--results-output-dir=./Scenario3 \
181
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
182
--mysql-table-engine=innodb \
185
#5) Stop mysqld process and restart it with both data and binlog on SSD
186
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/
188
MYSQLD_OPTIONS="--defaults-file=../scripts/config/mariadb_my.cnf --log-basename=/media/ssd_tmp/vlado_bench_ssd/ssd_binlog --log-bin=1 --datadir=/media/ssd_tmp/vlado_bench_ssd/data"
191
#6) Execute the perl script for the second test with MariaDB + XtraDB with both data and binlog on SSD
192
cd $PROJECT_HOME/scripts/
193
perl bench_script.pl --max-time=$MAX_TIME \
194
--dbname=mariadb_5_2_7 \
196
--results-output-dir=./Scenario3 \
197
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
198
--mysql-table-engine=innodb \
201
#7) Stop mysqld process and restart it with data on HDD, and transactional log on SSD
202
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/
204
MYSQLD_OPTIONS="--defaults-file=../scripts/config/mariadb_my.cnf --log-basename=/media/ssd_tmp/vlado_bench_ssd/ssd_binlog --log-bin=1 --datadir=./data"
207
#8) Execite the perl script for the third test with data on HDD, and transactional log on SSD
208
cd $PROJECT_HOME/scripts/
209
perl bench_script.pl --max-time=$MAX_TIME \
210
--dbname=mariadb_5_2_7 \
212
--results-output-dir=./Scenario3 \
213
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
214
--mysql-table-engine=innodb \
217
#9) Stop the server after the tests are complete
218
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/
221
#10) Run the gnuplot script to generate a graphic
222
cd $PROJECT_HOME/scripts/
223
gnuplot gnuplot_scenario3.txt
225
echo "Scenario 3 complete"