-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_sysbench.sh
41 lines (35 loc) · 1.19 KB
/
run_sysbench.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
#!/bin/bash
user=3250a895faec44ce803f93a3418845d7
passwd=g5e729abtlh8nhyq
n_rows=1000000
# Options for test_file:
#
# /usr/share/sysbench/oltp_delete.lua
# /usr/share/sysbench/oltp_insert.lua
# /usr/share/sysbench/oltp_point_select.lua
# /usr/share/sysbench/oltp_read_only.lua
# /usr/share/sysbench/oltp_read_write.lua
# /usr/share/sysbench/oltp_update_index.lua
# /usr/share/sysbench/oltp_update_non_index.lua
# /usr/share/sysbench/oltp_write_only.lua
#
test_file="/usr/share/sysbench/oltp_read_write.lua"
echo "** Generating $n_rows rows of data **"
sysbench --mysql-host=127.0.0.1 --table_size=$n_rows \
--db-driver=mysql --mysql-db=service_instance_db --mysql-user=$user \
--mysql-password=$passwd $test_file prepare
echo "Done."
echo ""
echo "** Running the benchmark itself **"
sysbench --mysql-host=127.0.0.1 --table_size=$n_rows \
--db-driver=mysql --mysql-db=service_instance_db --mysql-user=$user \
--time=60 --threads=8 \
--mysql-password=$passwd $test_file run
echo "Done."
echo ""
echo "** Cleaning up **"
sysbench --mysql-host=127.0.0.1 --db-driver=mysql --mysql-db=service_instance_db \
--mysql-user=$user --mysql-password=$passwd \
$test_file cleanup
echo "Done."
echo ""