Hi Craig

thank you for answering to me

Actually I tested the code with this JVM settings: -Xms750m -Xmx4G 
 -XX:+UseConcMarkSweepGC (on my laptop I have 8G of RAM with Ubuntu OS)
I used this kind of settings for neo4j:
nodestore_mapped_memory_size=250M
relationshipstore_mapped_memory_size=3G
nodestore_propertystore_mapped_memory_size=250M
strings_mapped_memory_size=500M
arrays_mapped_memory_size=50
cache_type=strong

Note these are values in a properties file; I use them by this code:

PropertiesLoader pl = PropertiesLoader.getInstance();
 GraphDatabaseFactory gdbf = new GraphDatabaseFactory();
 GraphDatabaseBuilder gdbb = gdbf.newEmbeddedDatabaseBuilder(pl.
getNeo4jDbPath());
 gdbb.setConfig(GraphDatabaseSettings.nodestore_mapped_memory_size, pl.
getNodestoreMappedMemorySize());
 gdbb.setConfig(GraphDatabaseSettings.relationshipstore_mapped_memory_size,pl
.getRelationshipstoreMappedMemorySize());
 gdbb.setConfig(GraphDatabaseSettings.
nodestore_propertystore_mapped_memory_size, pl.
getNodestorePropertystoreMappedMemorySize());
 gdbb.setConfig(GraphDatabaseSettings.strings_mapped_memory_size, pl.
getStringsMappedMemorySize());
 gdbb.setConfig(GraphDatabaseSettings.arrays_mapped_memory_size, pl.
getArraysMappedMemorySize());
 gdbb.setConfig(GraphDatabaseSettings.cache_type,pl.getCacheType());
 gdbb.setConfig(GraphDatabaseSettings.use_memory_mapped_buffers, "true");
 graphDbService = gdbb.newGraphDatabase();

And, as you said Craig, I'm insisting on this issue becouse the AStar times 
seem to me really too much (also for 2 close nodes the ones with ID 1 and 
ID 2)
Actually I really don't know what else to try....

Angelo



> By the way, we read an OSM file and create our graph; actually we have 
> around 1 million of points. around 2 million of relationships and around 5 
> million of properites on relationships; by reading neo4j documentation it 
> seems to me that this DB dimension is really small and it's really well 
> handled by neo4j but in my case this doesn't seem to be real (maybe I'm 
> missing something)
>
> Actually our node creation code is the following one:
>
>  private long createGraphNode(OsmNodeWrapper osmNodeWrapper)
>  {
>  try
>  {
>  Map<String, Object> nodeProps = new HashMap<String, Object>();
>  double x = osmNodeWrapper.getLongitude();
>  double y = osmNodeWrapper.getLatitude();
>  nodeProps.put(OSMAttribute.LATITUDE_PROPERTY, y);
>  nodeProps.put(OSMAttribute.LONGITUDE_PROPERTY, x);
>  nodeProps.put(OSMAttribute.OSM_NODE_ID_PROPERTY, osmNodeWrapper.
> getOsmNodeId());
>  if (osmNodeWrapper.isTrafficSignal())
>  nodeProps.put(OSMAttribute.TRAFFIC_SIGNAL, true);
>  // Creo il nodo
>  long graphNodeId = inserter.createNode(nodeProps, mainNodeLabel);
>  // aggiungo l'identificativo del nodo sul grafo
>  osmNodeWrapper.setGraphNodeId(graphNodeId);
>  return graphNodeId;
>  }
>
> In our graph, we have only 2 types of relationships:
>
>    - *CAR_ONE_WAY_RELATION* for one way road with Direction OUTCOMING
>    - *CAR_BIDIRECTIONAL_WAY_RELATION* for bidirectional road with 
>    Direction BOTH
>
> This is the relationship creation code:
> //Create RelationShip
> Map<String, Object> relationProps = new HashMap<String, Object>();
> relationProps.put(OSMAttribute.EDGE_LENGTH_PROPERTY, lunghezzaArco);
> ....//other properties
> long relId = inserter.createRelationship(startNode, endNode, 
> "CAR_ONE_WAY_RELATION", relationProps);
>
> osmWayIdPropertyIndex.add(relId, relationProps)
>
> We configured the neo4j embedded by using the following parameters:
>
> neostore.nodestore.db.mapped_memory=100M
> neostore.relationshipstore.db.mapped_memory=3G
> neostore.propertystore.db.mapped_memory=100M
> neostore.propertystore.db.strings.mapped_memory=200M
> neostore.propertystore.db.arrays.mapped_memory=50M
> cache_type=strong
>
> As you can see we use a strong cache type; this means we cache all data in 
> memory. Moreover when out application starts we load all nodes and 
> properties in memory; n order to do this we use this code:
>
>
>  private void loadWholeGraphInMemory() throws PinfGraphServiceException{
>  StopWatch sw = new StopWatch();
>  sw.start();
>  Node start;
>  for ( Node n : ggo.getAllNodes() ) {
>  n.getPropertyKeys();
>  for ( Relationship relationship : n.getRelationships() ) {
>  start = relationship.getStartNode();
>  }
>  }
>  for ( Relationship r : ggo.getAllRelationships() ) {
>  start = r.getStartNode();
>  r.getPropertyKeys();
>  }
>  sw.stop();
>  logger.info("Grafo caricato in "+sw.getLastTaskTimeMillis()+" millis");
>
>
>  }
>
> We tried to execute the AStar algorithm between 2 points. The distance 
> between points is around 130 kilometers. In order to execute the algorithm 
> Neo4j takes around 4 seconds for returning a path and it seems to me really 
> too much; if i compare it to other software on the same OSM I have really 
> really really really different performance.
> Is there any way to improve the Algorithm performance? Where can we act to 
> have better performance? would be better to use the Traversal AStar? 
> Moreover is there any plan to implement bi-directional AStar and/or 
> Dijkstra?
>
> I guess that with this kind of perfomance, Neo4j is not suitable for my 
> scenario
>
> Thank you
> Angelo
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to