Re: [Neo4j] Warming the Graph at Neo4J startup

406 views
Skip to first unread message

Michael Hunger

unread,
Jun 30, 2012, 1:32:45 AM6/30/12
to ne...@googlegroups.com
Can you show the content of the file ? And beware the line-feed at the end of the line (imho it must be there).

And your initializer must be a part of a server extension which you have to set up in the neo4j-server.properties.

Otherwise you can also look into:
- just warming up the db at the start of your app
- write a neo4j kernel extension so it doesn't matter if you run server or embedded
- you can also use cypher start n=node(*) return count(n) for relationships start r=rel(*) return count(r)
- warm up the fs-caches (find graph.db -type f -exec dd if={} of=/dev/null bs=1M \; )
- make sure you have enough heap, perhaps use the gcr cache which is more efficient

Cheers

Michael

Am 30.06.2012 um 04:47 schrieb cds:

>
> What is the best way to warm the graph at startup? I want to load all nodes and relationships, which how will that code get executed?
>
> I created a a class
> public class GraphInitializer implements PluginLifecycle
>
> with a start method to load the nodes and rels and put the correct META-INF/services/org.neo4j.server.plugins.PluginLifecycle file in the right place, but the code is not getting executed.
>
> I'm using 1.7.2 . Any thoughts?
>
>
> Thanks
>

cds

unread,
Jun 30, 2012, 9:23:57 PM6/30/12
to ne...@googlegroups.com
Michael

thanks much. adding it as server extension in neo4j-server.properties did the trick.  

I'm using neo4j enterpise running as server.  You can please point me to some place with more information about your 4th bullet

- warm up the fs-caches (find graph.db -type f -exec dd if={} of=/dev/null bs=1M \; )  

Cheers

Michael Hunger

unread,
Jul 1, 2012, 2:14:06 AM7/1/12
to ne...@googlegroups.com
It is just loading the unix file system caches with the neo4j store files so that they are loaded faster by the OS.

dd reads blocks from a device/file to a device file in this case /dev/null which causes the fs-caches to be filled.

Michael
Reply all
Reply to author
Forward
0 new messages