A collection of JMH benchmarks which may be useful for measuring Armeria performance.
-Pjmh.include=<pattern>- The benchmarks to run, in a comma-separated regular expression. All benchmarks if unspecified.
grpc.downstream.DownstreamSimpleBenchmarkgrpc.downstream.DownstreamSimpleBenchmark.empty$
- The benchmarks to run, in a comma-separated regular expression. All benchmarks if unspecified.
-Pjmh.params=<spec>- The benchmark parameters. Uses the parameters specified in the benchmark code if unspecified.
clientType=NORMALnum=10,100;flowControl=false
- The benchmark parameters. Uses the parameters specified in the benchmark code if unspecified.
-Pjmh.fork=<integer>- The number of forks.
1if unspecified.
- The number of forks.
-Pjmh.iterations=<integer>- The number of iterations. JMH default if unspecified.
-Pjmh.warmupIterations- The number of iterations. Uses the value of
jmh.iterationsif unspecified.
- The number of iterations. Uses the value of
-Pjmh.profilers=<spec>- The profiler settings. Profiler disabled if unspecified.
jmh.extras.Async:asyncProfilerDir=...;flameGraphDir=...
- The profiler settings. Profiler disabled if unspecified.
-Pjmh.threads=<integer>- The number of threads. JMH default if unspecified.
-Pjmh.verbose- Increases the verbosity of JMH to
EXTRA.
- Increases the verbosity of JMH to
-Pjmh.jvmargs=<jvm options>- Additional JVM options.
-Xmx8192m -Xms8192m
- Additional JVM options.
-Pjmh.forcegc=<true|false>- Whether to force JVM garbage collection.
falseif unspecified.
- Whether to force JVM garbage collection.
Allow running perf as a normal user:
# echo 1 > /proc/sys/kernel/perf_event_paranoid
# echo 0 > /proc/sys/kernel/kptr_restrict
Install async-profiler and FlameGraph:
$ cd "$HOME"
$ git clone https://github.com/jvm-profiling-tools/async-profiler.git
$ git clone https://github.com/brendangregg/FlameGraph.git
$ cd async-profiler
$ make
When running a benchmark, specify -Pjmh.profilers option:
$ ./gradlew :benchmarks:jmh \
"-Pjmh.profilers=jmh.extras.Async:asyncProfilerDir=$HOME/async-profiler;flameGraphDir=$HOME/FlameGraph"
- Do not forget to wrap
-Pjmh.paramsand-Pjmh.profilersoption with double quotes, because otherwise your shell will interpret;as the end of the command. - See sbt-jmh documentation for more profiler options.