-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_full_benchmark.sh
102 lines (88 loc) · 2.81 KB
/
run_full_benchmark.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
# This script makes use of homebrew and the brew packages postgresql@13 and mysql
# The script can be run with bash run_full_benchmark
#
echo Ensuring databases services are running
brew services start postgresql@13
brew services start mysql
echo Creating databases
psql -h localhost -d postgres -U root -f create_postgres.sql
mysql -u root < create_mysql.sql
echo Creating tables
pipenv run python3 create_postgres_tables.py
pipenv run python3 create_mysql_tables.py
### Test 1
echo Loading data for benchmark test 1 - 1,000 records per table
# Load 10,000 records per table
pipenv run python3 load_data.py 1000
echo
echo -------------------------------
echo Benchmarking Postgres test 1
brew services stop mysql
pipenv run python3 benchmark_postgres.py
echo -------------------------------
echo
echo -------------------------------
echo Benchmarking MySQL test 1
brew services start mysql
brew services stop postgresql@13
pipenv run python3 benchmark_mysql.py
echo -------------------------------
### Test 2
echo
echo Loading data for benchmark test 2 - 4,000 records per table
brew services start postgresql@13
# Load an additional 90,0000 records to get to 100,000 records per table
pipenv run python3 load_data.py 3000
echo -------------------------------
echo Benchmarking Postgres test 2
brew services stop mysql
pipenv run python3 benchmark_postgres.py
echo -------------------------------
echo
echo -------------------------------
echo Benchmarking MySQL test 2
brew services start mysql
brew services stop postgresql@13
pipenv run python3 benchmark_mysql.py
echo -------------------------------
### Test 3
echo
echo Loading data for benchmark test 3 - 7,000 records per table
brew services start postgresql@13
# Load an additional 100,000 records to get to 200,000 records per table
pipenv run python3 load_data.py 3000
echo
echo -------------------------------
echo Benchmarking Postgres test 3
brew services stop mysql
pipenv run python3 benchmark_postgres.py
echo -------------------------------
echo
echo -------------------------------
echo Benchmarking MySQL test 3
brew services start mysql
brew services stop postgresql@13
pipenv run python3 benchmark_mysql.py
echo -------------------------------
### Test 4
echo
echo Loading data for benchmark test 4 - 10,000 records per table
brew services start postgresql@13
# Load an additional 100,000 records to get to 300,000 records per table
pipenv run python3 load_data.py 3000
echo
echo -------------------------------
echo Benchmarking Postgres test 4
brew services stop mysql
pipenv run python3 benchmark_postgres.py
echo -------------------------------
echo
echo -------------------------------
echo Benchmarking MySQL test 4
brew services start mysql
brew services stop postgresql@13
pipenv run python3 benchmark_mysql.py
echo -------------------------------
echo
echo Benchmark Complete