Changing Neo4j transaction log rotation period


Overview

Neo4j - the graph database system used to power the CAST Imaging results - keeps track of all write operations to each database to ensure data consistency and enable recovery. This information is stored in files known as transactional logs and is stored in %PROGRAMDATA%\CAST\Imaging\CAST-Imaging-Viewer\Neo4jData\transactions\neo4j. Out of the box CAST Imaging is configured to store transactional logs as follows:

  • Max size of the current transactional log file: 250MB (when the file reaches this size it is archived and a new file is started)
  • Max number of transactional log files retained on disk: 10 (when the total number of files reaches 10, the next new transactional log file created will cause the oldest archive to be deleted from disk).

This means that the total size of the transactional log files should not exceed 2.5GB. However if you are facing disk space issues due to the size of the transaction log files, you can change the default behaviour as described below.

Step 1 - Edit the neo4j.conf file

Locate the following file depending on your operating system:

%PROGRAMDATA\CAST\Imaging\CAST-Imaging-Viewer\setup-config\neo4j\neo4j.conf
/home/CAST/imaging-viewer/neo4j/configuration/neo4j.conf

Edit the file, update the following entries as required by your environment and then save the file:

db.tx_log.rotation.retention_policy=10 files
db.tx_log.rotation.size=250M

Step 2 - Restart services

Finally, restart the following services/containers to ensure your changes are taken into account:

Microsoft Windows Linux via Docker
  • CAST Imaging Viewer Neo4j Graph DB
  • neo4j