forked from occlum/occlum
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_benchmarks.sh
executable file
·58 lines (51 loc) · 1.41 KB
/
run_benchmarks.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
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
set -e
GREEN='\033[1;32m'
NC='\033[0m'
function run_benchmarks()
{
WORKLOADS=("oltp_point_select" "oltp_write_only" "oltp_read_write")
for item in ${WORKLOADS[@]}
do
echo "${GREEN}start to prepare for $item${NC}"
sleep 3
sysbench /usr/share/sysbench/$item.lua\
--mysql-host='127.0.0.1'\
--mysql-user=root\
--time=60\
--mysql-db=mysql\
--tables=3\
--table_size=100000\
--rand-type=pareto\
prepare
echo "${GREEN}start to run $item${NC}"
sleep 3
sysbench /usr/share/sysbench/$item.lua\
--mysql-host='127.0.0.1'\
--mysql-user=root\
--time=60\
--mysql-db=mysql\
--tables=3\
--table_size=100000\
--rand-type=pareto\
--threads=2\
--report-interval=10\
run
echo "${GREEN}start to cleanup $item${NC}"
sleep 3
sysbench /usr/share/sysbench/$item.lua\
--mysql-host='127.0.0.1'\
--mysql-user=root\
--time=60\
--mysql-db=mysql\
--tables=3\
--table_size=100000\
--rand-type=pareto\
--threads=2\
--report-interval=10\
cleanup
done
echo "all done"
}
echo -e "${GREEN}Run benchmarks using sysbench${NC}"
run_benchmarks