Linux Out of Memory killer

The Out Of Memory Killer or OOM Killer is a process that the linux kernel employs when the system is critically low on memory. This situation occurs because the linux kernel has over allocated memory to its processes. When a… Read more →

Explore:  


Diagnose storage performance issues

Slow storage can affect Neo4j performance, therefore we recommend using Solid State Drives in the product documentation. Benchmark your underlying system On Ubuntu or RedHat, you can use fio tool to benchmark your underlying storage. The command below will create… Read more →

Explore:  


Understanding Neo4j Query Plan Caching

This article is based on the behavior of Neo4j 2.3.2. Query plan caching is governed by three parameters, as defined in the conf/neo4j.properties file, which are detailed here. The three parameters which govern whether a Cypher statement is planned/replanned are:… Read more →

Explore:  


Understanding transaction and lock timeouts

One way to handle runaway queries is to impose a time limit that will terminate a query when exceeded. There are some subtleties here that need to be understood to ensure proper behavior and avoid confusion. Defining a transaction timeout… Read more →

Explore:  


Understanding memory consumption

So you have configured Neo4j to use 4GB of heap and 6GB of page cache and sat back relaxed, thinking the Java process would not go above 10GB in your 12GB machine only to realise that Neo4j had an OOM… Read more →

Explore:  


Understanding the Query Plan Cache

When a Cypher statement is first submitted Neo4j will attempt to determine if the query is in the plan cache before planning it. By default Neo4j will keep 1000 query plans in cache based upon the conf/neo4j.conf parameter of dbms.query_cache_size.… Read more →

Explore:  


How do I run Consistency Check Manually?

If you skip the Consistency Check part of neo4j-backup, or you want to check that all is well with a data store, you can run the tool against an offline store. $ java -cp ‘lib/*:system/lib/*’ org.neo4j.consistency.ConsistencyCheckTool /tmp/graph.db On a Windows… Read more →

Explore:  


Running copy store tool on windows

The copy store utilities is a set of tools to compact, copy, fix and analyse Neo4j stores. You might already know this but if not, you can read more about it here. You will notice that the execution is done… Read more →

Explore:  


Lock Manager Differences Explained

Work in Progress Community: uses Java intrinsic locks, i.e. ’synchronized’. this might not perform that well on multiprocessor machines uses Thread.sleep() and Thread.interrupt() to wait for locks. this involves context switches which can be expensive keeps global graph or all… Read more →

Explore:  


Warm the cache to improve performance from cold start

Note For Neo4j 2.3+ there is no object cache anymore, so this warms up the page-cache which maps the Neo4j store files into memory. You may find that some queries run much faster the second time they run. This is… Read more →

Explore:  


Throttling Bolt Requests

When large amounts of data are sent between a Neo4j database and a client (typically large query results, from server to client), there are a few hidden throttling mechanisms that may come into play. TCP Throttling Bolt connections between a… Read more →

Explore:  


Cross Product Cypher queries will not perform well

Just like SQL, if you do not properly connect the parts of your query, it will result in a cross (cartesian) product, which is seldom what you want. Take the following example: MATCH (p:Person), (m:Movie) RETURN p, m; In Cypher,… Read more →

Explore:  


Performing pattern negation to multiple nodes

Some use cases require matching to nodes which aren’t connected to any of some other set of nodes. We’ll discuss both incorrect and correct approaches to this kind of query. For our examples we’ll use a recipe graph, where the… Read more →

Explore:  


How to configure off-heap transaction state

Warning This feature is experimental in 3.5, on by default in 4.0. Commencing with Neo4j 3.5, it is possible to store some of transactions’ data in off-heap memory. This can help to reduce GC pressure and/or prevent OOM crashes in… Read more →

Explore:  


How do I improve the performance of counting number of relationships on a node

Using Cypher one could count number of relationships in the following manner MATCH (n:Actor {name:’Sylvester Stallone’})–>() RETURN count(*); Which will report the number of incoming/outgoing relationships for the Actor named Sylvester Stallone. Using bin/neo4j-shell and running a profile on the… Read more →

Explore:  


Retired: How can I skip Consistency Check during Backup?

Backups in Neo4j automatically run a consistency check against the backed-up store. The backup itself does not take overly long, but the consistency check can take much more time to complete, depending on the store. In some cases, you want… Read more →

Explore:  


How to diagnose locking issues

Since Neo4j 3.4 it’s possible to better understand locking issues caused by concurrent query. This KB article will not detail the basics of locking in Neo4j. We assume a situation where you concurrently run lots of queries – might be… Read more →

Explore:  


Tuning Cypher queries by understanding cardinality

Cardinality issues are the most frequent culprit in slow or incorrect Cypher queries. Because of this, understanding cardinality, and using this understanding to manage cardinality issues, is a critical component in Cypher query tuning, and query correctness in general. A… Read more →

Explore:  


Retired: How to manually clear the Node and Relationship Cache

Note This is no longer applicable in Neo4j 2.3+ The second level object cache was removed in favor of a more scalable off-heap page-cache. When troubleshooting transient issues or testing out queries on warm vs. cold cache, you may want… Read more →

Explore: