diff --git a/doc/devel/Benchmarking.md b/doc/devel/Benchmarking.md index 3e48dc4f08e023be625bfaeaa2d645e73b2a9345..7800d568b3cb80bb61281281fcb86d5d4a2d2a33 100644 --- a/doc/devel/Benchmarking.md +++ b/doc/devel/Benchmarking.md @@ -1,3 +1,17 @@ +# Profiling # + +If the server is started with the `run-debug-single` make target, it will expose +the JMX interface, by default on port 9090. Using a profiler such as VisualVM, +one can then connect to the CaosDB server and profile execution times. + +## Example settings for VisualVM ## + +In the sampler settings, you may want to add these expressions to the blocked +packages: `org.restlet.**, com.mysql.**`. Branches on the call tree which are +entirely inside the blacklist, will become leaves. Alternatively, specify a +whitelist, for example with `caosdb.server.database.backend.implementation.**`, +if you only want to see the time spent for certain MySQL calls. + # Manual Java-side benchmarking # Benchmarking can be done using the `TransactionBenchmark` class (in package diff --git a/makefile b/makefile index 98825d4baeb85f497d9825d651f2afbad1e92f7d..55631222cbb0613e6ccd634a609b594a50ff0951 100644 --- a/makefile +++ b/makefile @@ -25,6 +25,7 @@ SHELL:=/bin/bash JPDA_PORT ?= 9000 +JMX_PORT ?= 9090 compile: easy-units mvn compile @@ -39,7 +40,7 @@ run-debug: jar java -Xrunjdwp:transport=dt_socket,address=0.0.0.0:$(JPDA_PORT),server=y,suspend=n -Dcaosdb.debug=true -jar target/caosdb-server-0.1-SNAPSHOT-jar-with-dependencies.jar run-debug-single: - java -Xrunjdwp:transport=dt_socket,address=0.0.0.0:$(JPDA_PORT),server=y,suspend=n -Dcaosdb.debug=true -jar target/caosdb-server-0.1-SNAPSHOT-jar-with-dependencies.jar + java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$(JMX_PORT) -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xrunjdwp:transport=dt_socket,address=0.0.0.0:$(JPDA_PORT),server=y,suspend=n -Dcaosdb.debug=true -jar target/caosdb-server-0.1-SNAPSHOT-jar-with-dependencies.jar run-single: java -jar target/caosdb-server-0.1-SNAPSHOT-jar-with-dependencies.jar