4.8. Dynamic settings

This section describes how to change your Neo4j configuration while Neo4j is running, and which settings can be changed.

This section contains the following:

4.8.1. Introduction

Neo4j Enterprise Edition supports changing some configuration settings at runtime, without restarting the service.

Changes to the configuration at runtime are not persisted. To avoid losing changes when restarting Neo4j make sure to update neo4j.conf as well.

4.8.2. Discover dynamic settings

Use the procedure dbms.listConfig() to discover which configuration values can be dynamically updated, or consult Section 4.8.4, “Dynamic settings reference”.

Example 4.7. Discover dynamic settings
CALL dbms.listConfig()
YIELD name, dynamic
WHERE dynamic
RETURN name
ORDER BY name
LIMIT 4;
+----------------------------------------------+
| name                                         |
+----------------------------------------------+
| "dbms.checkpoint.iops.limit"                 |
| "dbms.logs.query.allocation_logging_enabled" |
| "dbms.logs.query.enabled"                    |
| "dbms.logs.query.page_logging_enabled"       |
+----------------------------------------------+
4 rows

4.8.3. Update dynamic settings

An administrator is able to change some configuration settings at runtime, without restarting the service.

Syntax:

CALL dbms.setConfigValue(*setting*, value)

Returns:

Nothing on success.

Exceptions:

Unknown or invalid setting name.

The setting is not dynamic and can not be changed at runtime.

Invalid setting value.

The following example shows how to dynamically enable query logging.

Example 4.8. Set a config value
CALL dbms.setConfigValue('dbms.logs.query.enabled', 'true')

If an invalid value is passed, the procedure will show a message to that effect.

Example 4.9. Try to set invalid config value
CALL dbms.setConfigValue('dbms.logs.query.enabled', 'yes')
Failed to invoke procedure `dbms.setConfigValue`: Caused by: org.neo4j.graphdb.config.InvalidSettingException: Bad value 'yes' for setting 'dbms.logs.query.enabled': must be 'true' or 'false'

To reset a config value to its default, pass an empty string as the value argument.

Example 4.10. Reset a config value to default
CALL dbms.setConfigValue('dbms.logs.query.enabled', '')

4.8.4. Dynamic settings reference

Table 4.5. Dynamic settings reference
Name Description

dbms.checkpoint.iops.limit

Limit the number of IOs the background checkpoint process will consume per second.

dbms.logs.query.allocation_logging_enabled

Log allocated bytes for the executed queries being logged.

dbms.logs.query.enabled

Log executed queries that take longer than the configured threshold, dbms.logs.query.threshold.

dbms.logs.query.page_logging_enabled

Log page hits and page faults for the executed queries being logged.

dbms.logs.query.parameter_logging_enabled

Log parameters for the executed queries being logged.

dbms.logs.query.rotation.keep_number

Maximum number of history files for the query log.

dbms.logs.query.rotation.size

The file size in bytes at which the query log will auto-rotate.

dbms.logs.query.runtime_logging_enabled

Logs which runtime that was used to run the query.

dbms.logs.query.threshold

If the execution of query takes more time than this threshold, the query is logged - provided query logging is enabled.

dbms.logs.query.time_logging_enabled

Log detailed time information for the executed queries being logged.

dbms.track_query_allocation

Enables or disables tracking of how many bytes are allocated by the execution of a query.

dbms.track_query_cpu_time

Enables or disables tracking of how much time a query spends actively executing on the CPU.

dbms.transaction.timeout

The maximum time interval of a transaction within which it should be completed.

dbms.tx_log.rotation.retention_policy

Make Neo4j keep the logical transaction logs for being able to backup the database.

dbms.tx_log.rotation.size

Specifies at which file size the logical log will auto-rotate.