All requests are slow with neo4j

I wrote a lot of requests using cypher, which take at least 200 ms per request. They are very simple, so it’s hard for me to determine where the bottleneck is.

Simple match with parameters, 2200 ms:

SimpleMatchWithParameters

A simple characteristic match with parameters, 200 ms:

SimpleDistinctMatchWithParameters

Way, 2500ms:

enter image description here

At first I thought the problem was due to lack of resources, because I ran neo4j and my application in the same field. Although the performance monitor showed that the processor and memory are mostly free and available, I moved the neo4j server to another local unit and observed a similar delay. Both servers are workstations with fairly new Xeon processors, 12 GB memory and SSDs for data storage. All of the above leads me to the idea that latency is not related to my equipment. OS - Windows 7.

200 200 .

, neo4j , JVM. .

Pastebin :

+4
3

[ , .]

@TFerrell: , " " . , Cypher. , node (, "Project" ).

Cypher node, node, .

, node .

+4

?

, .

, Neo4j node, , .

:

, 0:

match (n) where not n:Entity set n:Entity return count(*);

create constraint on (e:Entity) assert e.Id is unique;

:

match (n:Element {Id:{Id}}) return n

.

+4

, - , Windows ( ).

messages.log , , mmio , java- (old-gen), , ..

, mmio conf/neo4j.properties ( ). , #neostore. (.. #) .

- ( 3 ) (2M-, 10M rels, 20M-, 10- ):

 neostore.nodestore.db.mapped_memory=25M
 neostore.relationshipstore.db.mapped_memory=250M
 neostore.propertystore.db.mapped_memory=250M
 neostore.propertystore.db.strings.mapped_memory=250M
 neostore.propertystore.db.arrays.mapped_memory=0M

:

auto mmio: 134217728 + 134217728 + 536870912 + 536870912 + 1073741824 = 2.3GB
stores sizes: 1073920 + 1073664 + 3221698 + 3221460 + 1073786 = 9MB

JVM max: 3.11 RAM : 13.98 SWAP: 27.97 GB
max heaps: Eden: 1.16, oldgen: 2.33

:

neostore.propertystore.db.strings] brickCount=8 brickSize=134144b mappedMem=134217728b (storeSize=1073920b)
neostore.propertystore.db.arrays] brickCount=8 brickSize=134144b mappedMem=134217728b (storeSize=1073664b)
neostore.propertystore.db] brickCount=6 brickSize=536854b mappedMem=536870912b (storeSize=3221698b)
neostore.relationshipstore.db] brickCount=6 brickSize=536844b mappedMem=536870912b (storeSize=3221460b)
neostore.nodestore.db] brickCount=1 brickSize=1073730b mappedMem=1073741824b (storeSize=1073786b)
+2

Source: https://habr.com/ru/post/1531383/


All Articles