~maria-captains/mariadb-tools/trunk

« back to all changes in this revision

Viewing changes to sysbench-runner/shell_launcher.sh

  • Committer: Vladimir Cvetkov
  • Date: 2011-06-27 17:31:39 UTC
  • Revision ID: vlado@sofiasln.com-20110627173139-ysibnjzlwvqjtqaj
Committing sysbench-runner - a benchmarking tool that calls sysbench and outputs graphics

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
MYSQLADMIN="./bin/mysqladmin"
 
3
MYSQLADMIN_OPTIONS=""
 
4
MYSQLD_SAFE="./bin/mysqld_safe"
 
5
MYSQLD_OPTIONS=""
 
6
TIMEOUT=100
 
7
PROJECT_HOME="${HOME}/Projects/MariaDB";
 
8
MAX_TIME=10
 
9
WARMUP_TIME=30
 
10
 
 
11
function kill_mysqld {
 
12
        ./bin/mysqladmin --user=root shutdown 0
 
13
    killall -9 mysqld
 
14
#    rm -rf $DATA_DIR
 
15
#    rm -f $MY_SOCKET
 
16
#    mkdir $DATA_DIR
 
17
}
 
18
 
 
19
function start_mysqld {
 
20
    ./bin/mysqld_safe $MYSQLD_OPTIONS &
 
21
 
 
22
    j=0
 
23
    STARTED=-1
 
24
    while [ $j -le $TIMEOUT ]
 
25
        do
 
26
        $MYSQLADMIN $MYSQLADMIN_OPTIONS ping > /dev/null 2>&1
 
27
        if [ $? = 0 ]; then
 
28
            STARTED=0
 
29
 
 
30
            break
 
31
        fi
 
32
 
 
33
        sleep 1
 
34
        j=$(($j + 1))
 
35
    done
 
36
 
 
37
    if [ $STARTED != 0 ]; then
 
38
        echo '[ERROR]: Start of mysqld failed.'
 
39
        echo '  Please check your error log.'
 
40
        echo '  Exiting.'
 
41
 
 
42
        exit 1
 
43
    fi
 
44
}
 
45
 
 
46
 
 
47
 
 
48
echo "--- Running Scenario1 ---"
 
49
 
 
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"
 
54
kill_mysqld
 
55
start_mysqld
 
56
 
 
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 \
 
61
--keyword=scenario1  \
 
62
--results-output-dir=./Scenario1 \
 
63
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
 
64
--mysql-table-engine=innodb \
 
65
--parallel-prepare
 
66
 
 
67
#3) Switch to MariaDB
 
68
cd $PROJECT_HOME/mysql-5.5.13-linux2.6-x86_64/
 
69
kill_mysqld
 
70
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64
 
71
MYSQLD_OPTIONS="--defaults-file=$PROJECT_HOME/scripts/config/mariadb_my.cnf";
 
72
start_mysqld
 
73
 
 
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 \
 
78
--keyword=scenario1  \
 
79
--results-output-dir=./Scenario1 \
 
80
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
 
81
--mysql-table-engine=innodb \
 
82
--parallel-prepare
 
83
 
 
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 \
 
88
--keyword=scenario1  \
 
89
--results-output-dir=./Scenario1 \
 
90
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
 
91
--mysql-table-engine=pbxt \
 
92
--parallel-prepare
 
93
 
 
94
#6) Stop the server after the tests are complete
 
95
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/
 
96
kill_mysqld
 
97
 
 
98
#7) Run the gnuplot script to generate a graphic
 
99
cd $PROJECT_HOME/scripts/
 
100
gnuplot $PROJECT_HOME/scripts/gnuplot_scenario1.txt
 
101
 
 
102
echo "Scenario 1 complete"
 
103
 
 
104
 
 
105
 
 
106
: <<'END'
 
107
 
 
108
echo "--- Running Scenario2 ---"
 
109
 
 
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/
 
113
 
 
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"
 
117
kill_mysqld
 
118
start_mysqld
 
119
 
 
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 \
 
129
--parallel-prepare
 
130
 
 
131
#4) Switch to MariaDB 5.2.7
 
132
cd $PROJECT_HOME/mysql-5.5.13-linux2.6-x86_64/
 
133
kill_mysqld
 
134
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64
 
135
MYSQLD_OPTIONS="--defaults-file=../scripts/config/mariadb_my.cnf"
 
136
start_mysqld
 
137
 
 
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 \
 
147
--parallel-prepare
 
148
 
 
149
#6) Stop the server after the tests are complete
 
150
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/
 
151
kill_mysqld
 
152
 
 
153
#7) Run the gnuplot script to generate a graphic
 
154
cd $PROJECT_HOME/scripts/
 
155
gnuplot gnuplot_scenario2.txt
 
156
 
 
157
echo "Scenario 2 complete"
 
158
 
 
159
 
 
160
 
 
161
 
 
162
echo "--- Running Scenario3 ---"
 
163
#1) Create a folder on the SSD drive
 
164
#cd /media/ssd_tmp
 
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/
 
168
 
 
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
 
171
kill_mysqld
 
172
MYSQLD_OPTIONS="--defaults-file=../scripts/config/mariadb_my.cnf --log-basename=hdd_binlog --log-bin=1 --datadir=./data"
 
173
start_mysqld
 
174
 
 
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 \
 
179
--keyword=hdd  \
 
180
--results-output-dir=./Scenario3 \
 
181
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
 
182
--mysql-table-engine=innodb \
 
183
--parallel-prepare
 
184
 
 
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/
 
187
kill_mysqld
 
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"
 
189
start_mysqld
 
190
 
 
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 \
 
195
--keyword=ssd  \
 
196
--results-output-dir=./Scenario3 \
 
197
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
 
198
--mysql-table-engine=innodb \
 
199
--parallel-prepare
 
200
 
 
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/
 
203
kill_mysqld
 
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"
 
205
start_mysqld
 
206
 
 
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 \
 
211
--keyword=ssd_hdd  \
 
212
--results-output-dir=./Scenario3 \
 
213
--warmup-time=$WARMUP_TIME --warmup-threads=4 \
 
214
--mysql-table-engine=innodb \
 
215
--parallel-prepare
 
216
 
 
217
#9) Stop the server after the tests are complete
 
218
cd $PROJECT_HOME/mariadb-5.2.7-Linux-x86_64/
 
219
kill_mysqld
 
220
 
 
221
#10)  Run the gnuplot script to generate a graphic
 
222
cd $PROJECT_HOME/scripts/
 
223
gnuplot gnuplot_scenario3.txt
 
224
 
 
225
echo "Scenario 3 complete"
 
226
 
 
227
 
 
228
END