Performance issues with concurrent requests

Hello Everybody,

I recently started developing an app that uses neo4j. I am facing an issue when I am sending concurrent requests to the DB instance.

For example, if I call a simple match query

MATCH (n:Box) WHERE n.BoxId = $box1Id XOR n.BoxId = $box2Id RETURN n.BoxId limit 1

in a single thread 10 times, results will be returned within 10 ms (there is an index on BoxId property).

If I make the same 10 requests in parallel, then I will get results back in 10 s. One additional thing to note is that if I run 10 requests per thread, only the first request for each thread will take 10s to return, the rest of the requests will return within 10ms.

I tried updating the following things in server configuration:

dbms.connector.bolt.enabled=true
dbms.connector.bolt.thread_pool_min_size=10
dbms.connector.bolt.thread_pool_max_size=100
dbms.connector.bolt.thread_pool_keep_alive=10m

dbms.threads.worker_count=10

dbms.memory.heap.initial_size=1G
dbms.memory.heap.max_size=2G
dbms.memory.pagecache.size=1G

The code sample that I am using can be seen here.(using System;using System.Collections.Generic;using System.Threading;using - Pastebin.com)

The server settings that I am using can be seen here.(#*****************************************************************# Neo4j conf - Pastebin.com)

Thanks in advance

Yes i too face this issue, could someone from neo4j please help on this ?

I suppose the start is:

  • How many nodes are on your graph?
  • There are no details about the thread-to-connection configuration. (you can have 20 threads, 1 connection and it is serialising)
  • Are you measuring at the API end or the DB end? (in my case I am currently not caching anything on purpose, the API is a microservice that takes 10ms, and the queries take 1ms) - that's because the API has an overhead 'building-and-tearing' connections to the DB.