Article DetailsDetailsHelp DetailsWhen you have completed your initial Neo4j implementation, it is common to spend some time performance tuning to your workload. Start by considering the following options for optimizing your application performance on Neo4j AuraDB. The points below summarize an essential approach to achieving the best outcome. 1 - Review queries and data model Capture your Cypher queries You should review and list all the queries involved in the workload of your solution. The best starting point is to establish a good understanding of the sequence and frequency of the Cypher queries submitted. If your queries are somehow generated by a framework, it is essential that you log the generated Cypher, as it is often the starting point to make changes and review best practices. Profile the Cypher Produce an EXPLAIN and PROFILE plan (see here for explanations) by just prepending the keywords to your query to get the associated plan. The PROFILE plan will be the more useful of the two, so prioritize that one.Note: When using PROFILE you may need to run it multiple times to get the optimal value: the first time the query runs, it gets a full cycle of evaluation, planning, and interpreting before making its way into the query cache. Once in the cache, the subsequent execution time will improve. Also, always use parameters instead of literal values to benefit from the query cache. See this detailed guide for the steps on How to capture the execution plans. To best interpret the output, you should get familiar with the terms used: https://neo4j.com/docs/cypher-manual/current/execution-plans/operator-summary/ The different stages involved in an execution plan need to be understood: https://neo4j.com/docs/cypher-manual/current/execution-plans/ 2 - Index what matters Defining constraints and indexes is essential to achieve optimal performance as your data volume grows and for performing efficient queries. The runtime engine will need to evaluate the cost associated with a query; to get the best estimations, it will rely on defined indexes. You will likely be able to identify if/what index is missing from the execution plan. In other circumstances, you may think an index isn't available or possible, but at times it may also make sense to reconsider the model and create an intermediate node or another relationship type just to leverage an index. See this full and comprehensive documentation section on the subject of indexes. If you control the use of the defined indexes and want to fine-tune their usage in your query, you may want to try leverage them with using: https://neo4j.com/docs/cypher-manual/current/query-tuning/using/ 3 - Review metrics during the workload and find the right instance size With Aura, you can keep an eye on some key metrics to understand the resource constraints your instance may be throttled on. CPU Usage: A high load is generally expected when you have a computational heavy workload. Another common reason if the query isn't complex may be that the CPU is consumed with memory management. Out of Memory errors: Queries that handle or process too much data may lead to OOM. There are many built-in protections, but not everything can be constrained. Heap usage (Enterprise only): This helps you understand if the heap is exhausting vs the off-heap memory.Page cache Evictions: high values indicate that the memory is used intensely.Garbage Collection Time: this will indicate how hard the garbage collector works to allocate/free memory and allow the execution of your queries. When this gets high, you should also see a higher CPU load. At this stage, if you see the key metrics reporting too high, you may want to reconsider the instance sizing. A resize operation doesn't cause any downtime, and you would only pay for what you use. Note that you should always size your instance against your workload activity peaks. 4 - Consider concurrency Sometimes individual queries on their own are optimized and running fine, but the sheer volume and concurrency of operations can overwhelm your AuraDB instance. To review what's running at any given time (this makes particular sense if you have a long-running query), you can use these statements and list what is running. SHOW TRANSACTIONS see the full details in the documentation CALL dbms.listQueries() see the full details in the documentation 5 - Runtime engine / Cypher version The execution plan should show you the runtime that is selected for the execution of your query. Usually, the planner makes the right decision, but it may be worth checking at times if the other runtimes do not perform better. Here is a full explanation of the differences To invoke the use of a given runtime forcibly, simply prepend your cypher statement with: For pipelined runtime CYPHER runtime=pipelined For slotted runtime: CYPHER runtime=slottedFor parallel runtime: CYPHER runtime=parallel If you have a Cypher pattern that isn't performing without error or as well as in another prior version, you could also control the Cypher version used to interpret it using these options 6 - Network and the cost of the round-trip. With Aura, it is essential you consider the best cloud region as the physical distance is a direct factor in the achievable network latency.This post explains the constraints well and provides good measurements.The Query execution takes significantly more time while using Neo4j drivers article lists and explains the additional components that could contribute to the overheadWhen some event causes any network disruption between your application and Aura, you would be affected by round-trip network latency to re-submit a query. With Aura, this is particularly important because you will need to be using transaction functions: Python: https://neo4j.com/docs/python-manual/current/.NET: https://neo4j.com/docs/dotnet-manual/current/Go: https://neo4j.com/docs/go-manual/current/Java: https://neo4j.com/docs/java-manual/current/ JavaScript: https://neo4j.com/docs/javascript-manual/current/ See also:Neo4j Aura Performance Tuning and Analyzing: Schema, Data Model, Query Tuning InformationTitlePerformance tuning with Neo4j AuraDBArticle Created Date3/15/2024, 10:57 PMURL Name4404022359443-Performance-tuning-with-Neo4j-AuraDBLast Modified Date6/8/2026, 2:37 AM