Helpful Commands When Supporting Neo4j

Top 50 Slowest queries from Query log:

grep -i "INFO" query.log | sort -r -n -k 4 | head -50 > long_queries.log

Find Longest GC Pauses in debug or messages log:

grep -n -i blocked debug.log | sort -r -n -k 11 | head -10

Strip all comments / empty lines of neo4j.conf file:

grep -v "^#" neo4j.conf | sed -e '/^$/d' | sort

Find a class within a directory of jars:

for i in *.jar; do jar -tvf "$i" | grep -Hsi MyClass && echo "$i"; done

Take a thread dump:

jstack -f <neo4j process ID>