title: How to configure to make neo4j faster?
body: <p>I try to use neo4j to do some experiment about SNS. I have created a random graph consisted of 1 million users, 100 thousand items, and each user has about 100 friends and 100 favourite items. So there are about 1 million nodes and 200 million relationships in the graph and the graph files take up 4.8GB. All nodes only have an id and I have created index for them.
  Now I have used Java APIs to set up a small cluster to maintain this graph, which is consisted of three VMs. Each VM has <strong>16GB</strong> ram, Intel Xeon CPU 2.00GHz(8 cores). Below is some configuration:</p>
  
  <pre><code>config.put( "neostore.nodestore.db.mapped_memory", "150M");
  config.put("neostore.relationshipstore.db.mapped_memory", "5G");
  config.put( "neostore.propertystore.db.mapped_memory", "100M");
  config.put( "neostore.propertystore.db.strings.mapped_memory", "130M");
  config.put( "neostore.propertystore.db.arrays.mapped_memory", "130M");
  config.put( "node_auto_indexing", "true");
  config.put( "use_memory_mapped_buffers", "true");
  config.put( "neostore.propertystore.db.index.keys.mapped_memory", "150M");
  config.put( "neostore.propertystore.db.index.mapped_memory", "150M");
  </code></pre>
  
  <p>I use the gcr cache_type. I simply warm up the graph by traversing:</p>
  
  <pre><code>for ( Node n : GlobalGraphOperations.at(db).getAllNodes() ) {
      n.getPropertyKeys();
      for ( Relationship relationship : n.getRelationships() ) {
          start = relationship.getStartNode();
      }
  }
  </code></pre>
  
  <p>The cypher query :</p>
  
  <pre><code>start user=node:users({key}={value}) match user-[:FRIEND]-&gt;(friend)-[:LIKES]-&gt;(item) return item, collect(friend), count(0) order by count(0) desc limit 32;
  </code></pre>
  
  <p>,which means finding out one's friends' favourite items.
  I run the jar with the command:  <code>java -d64 -server -XX:+UseConcMarkSweepGC -XX:+UseNUMA -Xms10752m -Xmx10752m -Xmn2688m  -jar Neo4J-1.0-SNAPSHOT.jar</code></p>
  
  <p>Now, my experiment results:
  (1) single thread
  Each query costs about 70ms on average.
  (2) 8-thread
  Each query costs about 160ms on average, and many queries cost more than 500ms. The RPS is about 50/sec.</p>
  
  <p><strong>I want to improve the performance, but don't know how.</strong> It seems the ram is not enough to keep all the data, is that right?
  Besides, I' have tried the soft and strong cache_type, and the ram is full quickly when it's warming up.</p>
  
  <p>Please help me and teach me how to improve it.
  Thanks a lot.</p>