2
How to Install, Configure, and Run the CRUND Benchmark
3
======================================================
5
The benchmark consists of a generic Driver and multiple "*Load" classes,
6
which implement the benchmark's operations against different persistence
9
Depending upon which database APIs are to be benchmarked with CRUND, some
10
external software may need to be downloaded, installed, and configured.
13
0) Software Dependencies
15
These 3rd party software dependencies need to be satisfied for the
16
respective CRUND targets [in brackets, versions known to work]:
18
Action Target Dependencies
19
-------------------------------------------------------------------------------
20
build Java Driver, JDK [1.5 and 1.6]
22
-------------------------------------------------------------------------------
23
build C++ Driver, GNU gcc [4.0.1, 4.2.4, 4.4.0]
24
NdbApiLoad gmake [3.81]
25
"Martin's Little Helpers" Utilities
26
[shipped with CRUND, see below]
27
-------------------------------------------------------------------------------
28
build, run NdbJTieLoad NDB [7.1] (jar files + shared libraries)
29
-------------------------------------------------------------------------------
30
build, run ClusterjLoad NDB [7.1] (jar files)
31
-------------------------------------------------------------------------------
32
build JdbcLoad JDK [1.5]
33
-------------------------------------------------------------------------------
34
run JdbcLoad on MySQL MySQL Connector/J [5.1.7]
35
-------------------------------------------------------------------------------
36
build JpaLoad JPA [1.0 == EJB 3.0] (jar files)
37
-------------------------------------------------------------------------------
38
run JpaLoad on OpenJPA OpenJPA [1.2.2] has dependencies upon:
40
Apache Commons Lang [2.1]
41
Apache Commons Collections [3.2]
42
[Apache Commons Pool [1.3]]
43
Sourceforge Serp Bytecode lib [1.13]
44
on MySQL [see JdbcLoad on MySQL]
45
on Derby [see JdbcLoad on Derby]
46
-------------------------------------------------------------------------------
47
run JdbcLoad on Derby Apache Derby [10.4.2.0 and 10.5.1.1]
48
-------------------------------------------------------------------------------
49
build, run NdbjLoad ndb-bindings [0.7.3]
51
-------------------------------------------------------------------------------
54
For example, put dependencies into a local lib/ directory:
55
commons-collections-3.2.jar
59
derbytools-10.5.1.1.jar
60
geronimo-jpa_3.0_spec-1.0.jar
61
geronimo-jta_1.1_spec-1.1.jar
62
mysql-connector-java-5.1.11-bin.jar
69
Copy the sample configuration files (*.properties, *.cnf, and *.ini)
70
$ cp -v config_samples/* .
71
config_samples/config.ini -> ./config.ini
72
config_samples/crundClusterj.properties -> ./crundClusterj.properties
73
config_samples/crundMysql.properties -> ./crundMysql.properties
74
config_samples/crundNdbapi.properties -> ./crundNdbapi.properties
75
config_samples/crundNdbjtie.properties -> ./crundNdbjtie.properties
76
config_samples/crundOpenjpaClusterj.properties -> ./crundOpenjpaClusterj.properties
77
config_samples/crundOpenjpaMysql.properties -> ./crundOpenjpaMysql.properties
78
config_samples/crundRun.properties -> ./crundRun.properties
79
config_samples/env.properties -> ./env.properties
80
config_samples/my.cnf -> ./my.cnf
84
for all the paths to CRUND's external software dependencies.
86
Edit the other *.properties, *.cnf, and *.ini files for cluster setup
87
and benchmark run parameters.
90
2) Build "Martin's Little Helpers" Utilities
92
(Only needed if building/running NdbApiLoad or using 'make', see below)
94
See file README.txt in the subdirectory and run
95
$ cd martins_little_helpers/
102
3.1) Build the Java classes using Ant (for better diagnostics)
104
Ant is used to build the Java Driver and *Load classes.
106
For an overview of the supported targets:
109
Specific build targets:
111
$ ant compile.ndbjtie
112
$ ant compile.clusterj
115
$ ant compile // builds all of above
117
Additional compile.*.opt targets build optimized versions of the
118
classes (but typically, the performance difference can be neglected).
120
Other standard Ant targets:
126
3.2) Build all C++ binaries and Java classes using Make
128
For an overview of the supported targets:
133
to build the .depend files.
138
to build debug or optimized binaries and classes.
140
To build only the C++ classes run these make targets from subdirectory
143
To delete all temporary, +logging, +database files run
149
4) Start the Database and Load the Schema
153
CRUND's and TWS's schema file:
154
./src/tables_mysql.sql
155
./tws_benchmark/schema.sql
157
Edit these configuration files if using the convenience scripts below:
161
Convenience scripts to start/stop the cluster or to load the schema:
164
$ ./restart_cluster.sh
168
By default, log and data files are written to:
169
./scripts/ndblog/mysqld.log.err
172
4.2) Apache Derby (Optional)
174
CRUND's database schema file:
175
./src/tables_derby.sql
177
This Ant target loads the schema:
178
$ ant load.schema.derby
180
(Derby can be used in embedded or network server mode.)
185
5.1) Configure a benchmark run
187
Configure the benchmark's dataset size and number of iterations in
188
./crundRun.properties
190
Edit any load-specific connection and run settings:
191
./crundNdbapi.properties
192
./crundNdbjtie.properties
193
./crundClusterj.properties
194
./crundMysql.properties
195
./crundOpenjpaMysql.properties
196
./crundNdbj.properties
197
./crundOpenjpaDerby.properties
198
./crundDerby.properties
200
5.2) Run the benchmark
202
Run the benchmark's Java driver on the respective *Load classes:
207
$ ant run.openjpa.mysql
208
$ ant run.openjpa.clusterj
211
$ ant run.openjpa.derby
213
Or start the Load classes directly with run properties as arguments
214
to the main() method:
215
$ java -classpath=... com.mysql.cluster.crund.JdbcLoad \
216
-p crundRun.properties \
217
-p crundMysql.properties
219
(Check for correct classpath/libpath printed by the run.* targets.)
221
5.3) Inspect the result files
223
CRUND writes all measured time/memory values into a local log file:
224
./log_<dtate>_<time>.txt
226
The data format is a tab-separated list, which can be easily imported
227
into a spreadsheet application for further processing or charting.
229
5.4) Automate Benchmark runs
231
Run the Java/C++ driver on a *Load class and save the log files:
236
Runs the Java driver on multiple *Load classes:
240
Hints for troubleshooting:
242
- check the cluster's status
245
- create the database from the MySQL client tool
247
mysql> create database crunddb;
248
mysql> show databases;
250
- if create fails fue to lack of privileges, login as root and grant
253
mysql> grant all on *.* to <user name>@localhost;
254
mysql> grant all on *.* to ''@localhost;
256
- load the schema script
258
mysql> \. ./src/tables_mysql.sql
260
- check the database schema
262
mysql> use database crunddb;