Receive bad-gateway or timeout from cypher of neo4j

555 views Asked by At

I have a remote instance of neo4j that I feed through PHP code. Sending individual nodes has yielded no issue even at 500 nodes per transaction batch.

However when I run a cypher in order to create links among several thousands of nodes it fails because of a time out.

I have tried through UI Browser - the error is a gateway time out.

Through PHP code, I time out due to cURL. I have increased the time out to a large number and I have also set my php code execution time to 2hrs. The response I get back is a bad-gateway response.

I cannot access the neo4j node locally. I tried accessing it by installing neo4j-shell and using -host and -port command.

I get an error : non-JRMP server at remote endpoint

does anyone have a solution?

Edit

Cypher:

MATCH (a1:Author), (a2:Author)
WHERE a1 <> a2
MATCH (a1)-[:WRITES_IN]->(genre)<-[:WRITES_IN]-(a2)
    WITH a1, a2, count(genre) as intersect
MATCH (a1)-[:WRITES_IN]->(a1_f)
    WITH a1, a2, intersect, collect(DISTINCT a1_f) AS coll1
MATCH (a2)-[:WRITES_IN]->(a2_f)
    WITH a1, a2, collect(DISTINCT a2_f) AS coll2, coll1, intersect
    WITH a1, a2, intersect, coll1, coll2, length(coll1 + filter(x IN coll2 WHERE NOT x IN coll1)) as union
CREATE (a1)<-[:SIMILAR_TO { coef: (1.0*intersect/union) }]-(a2);

Edit 2:

I ran PROFILE before the cypher and I get a 504 gateway time-out (on php code and browser UI...im unable to connect remotely to try a neo4j-shell)

0

There are 0 answers