Experiment results for the thesis titled "FasterSparql: An architecture for query mediation over loosely coupled federations of knowledge graphs"
Authors/Creators
Description
fastersparql experiments
Directory structure:
results: files generated as result of benchmark$machine/current: JMH logs and JMH.jsonfiles of experiments that were not profiled$machine/current-profiler:.jfrfiles of experiments re-executed under async-profiler$machine.csv: CSV file aggregating all JMH.jsonresults in$machine/current$machine-profiler.csv: CSV file aggregating all JMH.jsonresults for executions in$machine/current-profilertasks.csv: CSV where each column correspond to a task, as defined in classJfr2Csvin thefastersparql-microbenchmodule
scripts:config.sh: configurations for scriptsdownload-lrb-*.sh: downloads a subset of indices which are used to run experiments.run.sh: executes all experiments, without profilingrun-profiler.sh: executes all experiments where the federation members and the mediator are hosted in the same JVM, under async-profiler
skel: initial contents of/home/userfor a new VM.bashrc: default from Ubuntu 24.04 with modified$PATH.tmux.conf: changesC-btoC-aapps/: ready-to-use JDK, node and Comunicafs-experiments: this is whereinit-vm.shwill place the contents ofscripts, and also where experiments results will be stored, in$(date -I)-results-${run_script_name}directorieslrb: all datasets (HDT/Virtuoso/TDB/MMFS are stored here)
Reproducing the experiments
Step 1: Acquire a VM
These experiments were done on Ubuntu 24.04 VMs and on physical machines running a current stable arch (September 2024). Ubuntu 20.04 also should work, as well as any contemporary Linux distribution, including distributions without systemd. Windows and macOS are not supported. While all involved software used in these experiments is multiplatform, the scripts use Linux-specific commands.
Step 2: Create a non-root user with sudo permission. Some scripts will issue sudo commands, for which you can manually type the password. Alternatively, you can allow specific commands to not require passwords, by adding this to the sudoers file:
# run-profiler.sh will temporarily allow kernel profiling and visibility of
# (hashed) kernel pointers
%sudo ALL=(ALL) NOPASSWD: /usr/sbin/sysctl
# hint: ./run.sh && sudo shutdown -h now will save some dollars
%sudo ALL=(ALL) NOPASSWD: /usr/sbin/shutdown
# sudo apt will only be invoked from inti-vm.sh
%sudo ALL=(ALL) NOPASSWD: /usr/bin/apt
Always edit the
sudoersfile withvisudo.
Step 4: With access to a fresh VM with hostname vm and a sudoer user user, run in the local machine:
scripts/init-vm.sh user@vm
This will upload the
skeland copy thescripts/contents into~/fs-experiments/
Step 5: Download/build datasets.
There are four sources for datasets:
download-lrb-*scripts will download HDT and TDB datasets from Zenodo- Virtuoso dumps must be downloaded from the links provided by LargeRDFBench
- LargeRDFBench-all.tdb must be built because it is too large for Zenodo
Be polite when using
download-lrb-*scripts, avoid too many concurrent downloads and prefer downloading into one machine you control and thersyncing into the other machines.
To build LargeRDFBench-all.tdb:
- Convert the LargeRDFBench-all.hdt file into a gzipped N-Triples file:
hdt2rdf -f ntriples LargeRDFBench-all.hdt - | gzip -c > LargeRDFBench-all.nt.gz - Build the TDB database on a POSIX system (only Linux was tested):
tdb2.xloader --loc LargeRDFBench-all.tdb LargeRDFBench-all.nt.gz
Building the TDB database will take 6~8 hours and will use 50% of physical RAM. This should be done on a server or VM instead of a workstation, since while the remainder 50% will not be directly used during the bulk load, the unused memory will be used for the Linux kernel page cache.
Step 6: customize the run.sh and run-profiler.sh scripts, ideally create a copy of those scripts with a descriptive name. Typical customization would be to remove/comment some sets of experiments, such as skipping experiments with TDB or not running B queries.
The run.sh and run-profiler.sh scripts group all experiments using the same set of files to re-use the Linux kernel page cache. The use of warm-up iterations should be enough to ensure reasonable I/O caching. However, doing this at the launcher script level avoids situations where, TDB fails to completely warm-up during warm-up iterations. The scripts and benchmark code strive to provide an equally optimistic assessment of all evaluated components. Thus, it tries to preserve the page cache instead of explicitly dropping caches before each experiment. Dropping I/O caches does provide interesting results but is not realistic since triple stores, like any database, are often long-lived processes, which actively attempt to benefit from the Linux kernel page cache.
experiments are parameterized. Therefore each run_bench describes a set of experiments by the combination of parameter values given as arguments to the run_bench bash function. Each experiment executes on a JVM fork, so that it is not influenced by garbage and configurations changes made by a previous experiment.
The core of experiment scripts are calls such as the following:
(FORKS=2 run_bench "$RESULTS_DIR" "C$i" FS_JSON_EMIT,FS_JSON_IT $FLOWS $B_JSON,CA 5min 5)
Where:
"C$i"is the query set that will be executed in this set of experiments.$iwill assume values 1 to 10 and.*FS_JSON_EMIT,FS_JSON_ITis a,-separated list of values from theSourceKindenum infastersparql-bench, in this case there will be experiments using a federation ofNettySparqlServerSPARQL endpoints using the JSON results serialization and in some experiments theNettySparqlServerwill drain from the underlying MMFS triple store (afastersparqlinstance over a single MMFS directory) using an iterator and in other experiments using an emitter$FLOWS, which is defined asEMIT,ITERATEsets which flow models should be used by the drainer which will drain the queries in the query set from the federation$B_JSON,CA, which expands into asCOMPRESSED,TERM_NI,CAdefines which batch types must be used when draining queries5minis the iteration timeout: If this is reached, the query being currently mediated is cancelled. If cancellation is not completed in 1 minute, the entire experiment is aborted (i.e., there is a deadlock/hang).5is the number of iterations per forked JVMFORKS=2defines the number of forked JVM that will be spawned for each combination of experiment parameters. In this case, there will be two forks, which will execute sequentially, leading to a total of 10 iterations, all executed sequentially
Step 7: run the experiments, for example:
./run.sh ; ./run-profiler.sh ; (sleep 30s && sudo shutdown -h now)
This will generate two new directories on ~/fs-experiments:
$(date -I)-run: logs and results from./run.sh$(date -I)-run-profiler: logs and results from./run-profiler.sh
Step 8: copy the result directories into results/$machine/current and results/$machine/current-profiler in your local machine (since the VM is disposable).
The
$(date -I)-run-profilerdirectory can have 4 GiB or more, due to the.jfrfiles collected by async-profiler.
Processing experiment results
To process experiment results, use scripts/process-results.sh:
./scripts/process-results.sh results
This will take more than 29 hours of 100% CPU usage on all cores with consistently high CPU temperatures (~90º C). Consider running this on a VM and use
cpupowerto prevent hardware damage:
cpupower frequency-set --max 3.5GHz
The result of this processing will be a $machine.csv and a $machine-profiler.csv files in results/. These files describe and provide the average invocation time of each iteration executed during experiments. Note that experiments have the following containment relationships:
run.shissues multiple calls to:run_bench, which for each combination of parameter values will execute one:- experiment, which consists of one or more:
- forked JVMs, each performing
- 3 warm-up iterations, and
- n (i.e. 5 or 10) measurement iterations, where each iteration has an unbounded number of
- invocations, where each invocation drains all results of all queries in the query set of the experiment.
- forked JVMs, each performing
- experiment, which consists of one or more:
The st.csv file was generated by thesis.Rmd after processing all iterations on all $machine.csv files. st.csv contains the bootstrapped mean and its 95% confidence interval considering all iterations in all experiments.
Notes
Files
README.md
Files
(14.3 GB)
| Name | Size | |
|---|---|---|
|
md5:c641068e45fbb5132427a66319f44408
|
9.1 kB | Preview Download |
|
md5:f2d96786da08bd0fe8f147ec888ae7a8
|
13.7 GB | Download |
|
md5:a64a2f1a2a05985615b382a54a91867f
|
254.6 kB | Download |
|
md5:1972fd1cdabc7695af36a79da13729a7
|
633.1 MB | Download |
|
md5:24e9af7b9087752a4dacb941792507f9
|
24.7 MB | Preview Download |
|
md5:0f684f5d8990f32ce06d5a56b1707511
|
143.1 kB | Download |