Add notes for 2020-02-07

This commit is contained in:
2020-02-07 14:44:08 +02:00
parent 38177b2a6f
commit 009cc870ba
7 changed files with 17564 additions and 8 deletions

View File

@ -303,4 +303,40 @@ $ ./run.sh -s http://localhost:8983/solr/statistics -a import -o ~/Downloads/sta
- OK that imported! I wonder if it works... maybe I'll try another day
## 2020-02-07
- I did some investigation into DSpace indexing performance using flame graphs
- Excellent introduction: http://www.brendangregg.com/flamegraphs.html
- Using flame graphs with java: https://netflixtechblog.com/java-in-flames-e763b3d32166
- Fantastic wrapper scripts for doing perf on Java processes: https://github.com/jvm-profiling-tools/perf-map-agent
```
$ cd ~/src/git/perf-map-agent
$ cmake .
$ make
$ ./bin/create-links-in ~/.local/bin
$ export FLAMEGRAPH_DIR=/home/aorth/src/git/FlameGraph
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
$ export JAVA_OPTS="-XX:+PreserveFramePointer"
$ ~/dspace63/bin/dspace index-discovery -b &
# pid of tomcat java process
$ perf-java-flames 4478
# pid of java indexing process
$ perf-java-flames 11359
```
- All Java processes need to have `-XX:+PreserveFramePointer` if you want to trace their methods
- I did the same tests against DSpace 5.8 and 6.4-SNAPSHOT's CLI indexing process and Tomcat process
- For what it's worth, it appears all the Hibernate stuff is in the CLI processes, so we don't need to trace the Tomcat process
- Here is the flame graph for DSpace 5.8's `dspace index-discovery -b` java process:
![DSpace 5.8 index-discovery flame graph](/cgspace-notes/2020/02/flamegraph-java-cli-dspace58.svg)
- Here is the flame graph for DSpace 6.4-SNAPSHOT's `dspace index-discovery -b` java process:
![DSpace 6.4-SNAPSHOT index-discovery flame graph](/cgspace-notes/2020/02/flamegraph-java-cli-dspace64-snapshot.svg)
- If the width of the stacks indicates time, then it's clear that Hibernate takes longer...
- Apparently there is a "flame diff" tool, I wonder if we can use that to compare!
<!-- vim: set sw=2 ts=2: -->