How to compare performance on neo4j queries without cache?

自古美人都是妖i 提交于 2020-01-14 13:37:30

问题


I've been trying to compare queries performance in neo4j.

In order to make the queries more efficient, I added index, analysed the result using profile, and tried doing the same while using the USING INDEX.

On most queries, DB Hits were much better using the second option (with the USING INDEX), rows were the same or less, but the time performance seems not to be reliable: on several queries adding the USING INDEX was slower though the better performance parameters (db hits & rows)and times got much better by re-executing a query.

In order to stop the cache's interfering, went to the the properties file, changed the cache_type in the neo4j.properties to none and restarted neo, but it still seems like the results of the same query comes faster each time (until a certain point).

What will be the best way to test it?


回答1:


Neo4j has (up to 2.2.x) a two layered cache architecture. With cache_type=node you switch of just the object cache. To disable page cache, you can use dbms.pagecache.memory=0. However if all caches are disabled you basically measure the speed of your IO subsystem since every query goes down to the bare metal and reads from disc.

I recommend a different approach: enable both caches and run the queries you want to compare multiple times to warm up caches. Take measurement on warmed cache since this is much closer to a real production scenario.

On a side note: in Neo4j 2.3 the object cache will go away and we just have the page cache.



来源:https://stackoverflow.com/questions/31579763/how-to-compare-performance-on-neo4j-queries-without-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!