Skip to content

Instantly share code, notes, and snippets.

@ajason08
Last active November 21, 2018 14:54
Show Gist options
  • Save ajason08/0de248378a1bb5028572727eb5a0fdb0 to your computer and use it in GitHub Desktop.
Save ajason08/0de248378a1bb5028572727eb5a0fdb0 to your computer and use it in GitHub Desktop.
Neo4j memory management
First understand the concepts
https://neo4j.com/developer/guide-performance-tuning/
https://neo4j.com/docs/operations-manual/current/performance/memory-configuration/#heap-sizing
https://neo4j.com/docs/operations-manual/current/performance/#memory-tuning
run $NEO4J_HOME/conf/neo4j.conf
Heap: is for queries and transactions
chache: is for retrieve easier from hard disk (I think)
Decide how much ram mem you want to give for
OS operations: maybe 8g in my case. servers(1-3GB fully neo4j dedicated)
It is not possible to explicitly configure this you can estimate it setting heap and cache
also consider neo4j will use also this space for lucene
Heap: "enough" for your transaction needs
For example, long-running queries, or very complicated queries, are likely to require a larger heap than simpler queries.
to determine it tune our queries, and monitor their memory usage
Parameters: set them to the same value for avoid unwanted full garbage collection pauses.
dbms.memory.heap.initial_size and dbms.memory.heap.max_size.
cache: the rest
dbms.memory.pagecache.size
a way to estimate it is set it = (Data volume and native indexes)*1.2
use memrec, the 0.2 additional is because future growing of db
check neo4j automatic recommendation
bin/neo4j-admin memrec --database=graph.db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment