The neo4j.conf file

For a complete reference of Neo4j configuration settings, see Configuration settings.

Introduction

The neo4j.conf file is the main source of configuration settings in Neo4j, and includes the mappings of configuration setting keys to values. The location of the neo4j.conf file in the different configurations of Neo4j is listed in Default file locations.

Most of the configuration settings in the neo4j.conf file apply directly to Neo4j itself, but there are also some settings which apply to the Java Runtime (the JVM) on which Neo4j runs. For more information, see the JVM specific configuration settings below. Many of the configuration settings are also used by the neo4j launcher scripts.

Syntax

  • The equals sign (=) maps configuration setting keys to configuration values.

  • Lines that start with the number sign (#) are handled as comments.

  • Empty lines are ignored.

  • Configuring a setting in neo4j.conf will overwrite any default values. In case a setting can define a list of values, and you wish to amend the default values with custom values, you will have to explicitly list the default values along with the new values.

  • There is no order for configuration settings, and each setting in the neo4j.conf file must be uniquely specified. If you have multiple configuration settings with the same key, but different values, this can lead to unpredictable behavior.

    The only exception to this is dbms.jvm.additional. If you set more than one value for dbms.jvm.additional, then each setting value will add another custom JVM argument to the java launcher.

JVM-specific configuration settings

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The Java heap is where the objects of a Java program live. Depending on the JVM implementation, the JVM heap size often determines how and for how long time the virtual machine performs garbage collection.

Table 1. JVM-specific settings
Setting Description

dbms.memory.heap.initial_size

Sets the initial heap size for the JVM. By default, the JVM heap size is calculated based on the available system resources.

dbms.memory.heap.max_size

Sets the maximum size of the heap for the JVM. By default, the maximum JVM heap size is calculated based on the available system resources.

dbms.jvm.additional

Sets additional options for the JVM. The options are set as a string and can vary depending on JVM implementation.

If you want to have good control of the system behavior, it is recommended to set the heap size parameters to the same value to avoid unwanted full garbage collection pauses.

List currently active settings

You can use the procedure dbms.listConfig() to list the currently active configuration settings and their values.

Example 1. List currently active configuration settings
CALL dbms.listConfig()
YIELD name, value
WHERE name STARTS WITH 'dbms.default'
RETURN name, value
ORDER BY name
LIMIT 3;
+-------------------------------------------------+
| name                              | value       |
+-------------------------------------------------+
| "dbms.default_advertised_address" | "localhost" |
| "dbms.default_database"           | "neo4j"     |
| "dbms.default_listen_address"     | "localhost" |
+-------------------------------------------------+

For information about dynamic settings, see Update dynamic settings.