i developed plugin of own in neo4j in order speed process of inserting node. because needed insert node , relationship if didn't exists before can slow using rest api.
if try call plugin 100 time, inserting 100 nodes , 100 relationship each time, take approximately 350ms on each call. each call inserting different nodes, in order rule out locking cause.
however if parallelize calls (2, 3 , 4... @ time), response time drop accordingly parallelism degree. takes 750ms insert 200 objects when 2 call @ time, 1000ms when 3 etc.
i'm calling plugin .net mvc controller, using httpwebrequest. set maxconnection 10000, , can see tcp connection opened.
i investigated little on issue seems wrong. must have done wrong, either in neo4j configuration, or in plugin code. using visualvm found out threads launched neo4j handle calls working sequentially. see picture linked.
http://i.imgur.com/vpwofth.png
my conf : windows 8, 2 core 8g of ram neo4j 2.0m03 installed service no conf tuning
hope able me. is, unable use neo4j in production, there tens of concurrent calls, cannot done sequentially.
neo4j transactional. every commit triggers io operation on filesystem needs run in synchronized block - explains picture you've attached. therefore it's best practice run writes single threaded. pre-processing prior can of course benefit parallelizing.
in general maximum performance go stable version (1.9.2 of today). milestone builds not optimized yet, might wrong picture.
another thing consider transaction size used in plugin. 10k 50k in single transaction should give best results. if transactions small, transactional overhead significant, in case of huge transactions, need lots of memory.
write performance heavily driven performance of underlying io subsystem. if possible use fast ssd drives, better stripe then.
Comments
Post a Comment