-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_mysql.sh
executable file
·50 lines (40 loc) · 1.42 KB
/
run_mysql.sh
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
#!/bin/bash
set -e
set -o pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
source $DIR/common.sh
setup "$1"
WORKLOAD_NAME="mysql"
###############
# MySQL
###############
for i in {0..4}
do
# We need to load & unload after each experiment to make sure we get clean results
# Load the benchmark data
sysbench \
--db-driver=mysql --mysql-host=$(echo "$ADDRESS" | cut -d'@' -f2-) --mysql-port=3306 \
--mysql-user=user --mysql-password=user --mysql-db=sbtest \
--tables=1 --table-size=10000 oltp_read_write prepare
# Clear previous file
clear_stats_entries "${WORKLOAD_NAME}_$1_$i"
add_miralis_stat_entry "${WORKLOAD_NAME}_$1_$i"
sysbench \
--db-driver=mysql --mysql-host=$(echo "$ADDRESS" | cut -d'@' -f2-) --mysql-port=3306 \
--mysql-user=user --mysql-password=user --mysql-db=sbtest \
--tables=1 --table-size=10000 --threads=128 \
--time=300 --report-interval=20 oltp_read_write \
run > "results/${WORKLOAD_NAME}_$1_$i.txt"
add_miralis_stat_entry "${WORKLOAD_NAME}_$1_$i"
# Remove the benchmark data
sysbench \
--db-driver=mysql \
--mysql-host=$(echo "$ADDRESS" | cut -d'@' -f2-) \
--mysql-port=3306 \
--mysql-user=user \
--mysql-password=user \
--mysql-db=sbtest \
--tables=1 \
oltp_read_write \
cleanup
done