We're running into performance problems while running a Neo4j
database on one server, and using it from a different server within the same network. The main problem is, while running the same integration tests periodically, they become slower over time.
Our current setup is:
Tinkerpop3
graph API (Java) on server 1, usingneo4j-gremlin-bolt
to use this API with a remoteNeo4j
server viaBolt
protocol- Server 2 running
Neo4j
3.0.4
In Java on server 1, we have integration tests with these imports:
import org.neo4j.driver.v1.Driver;
import org.neo4j.driver.v1.GraphDatabase;
import com.steelbridgelabs.oss.neo4j.structure.Neo4JGraph;
import org.apache.tinkerpop.gremlin.structure.Graph;
And code similar to:
Driver driver = GraphDatabase.driver(...);
public void clearGraph() {
Graph graph = new Neo4jGraph(driver,...);
try (Transaction transaction = graph.tx()) {
// Query/add/delete data in the graph.
transaction.commit();
}
graph.close();
}
Although our test periodically removes all nodes and relations from the Neo4j
database, we observe performance problems.
- Continuous database size growth: the nodestore.db and relationshipstore.db do still grow even after removing all nodes. This issue is discussed here. I couldn't solve this yet, but it's not crucial at the moment.
- A critical issue then is the fact that our test gets slower over time. Apparently,
Bolt
itself has way higher latency compared to theHTTP
client as mentioned here. However, does not explain the constant slowing we have to deal with. None of this or this helped, and neither using store-utils nor removing the whole graph directory are reasonable options for a planned live system.
My central question is: Did we do a logical mistake setting up our Java-Neo4j connection, or is there a crucial performance issue with Neo4j? (since I found the mentioned similar posts)