Skip to content

Commit 2d3ae6a

Browse files
committed
Minimize Neo4j transaction log disk space utilization
1 parent 7426d70 commit 2d3ae6a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

scripts/configuration/template-neo4j-v4.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ dbms.jvm.additional=-XX:+ExitOnOutOfMemoryError
1919
dbms.memory.transaction.global_max_size=6g
2020

2121
# Memory: Limit the amount of memory that a single transaction can consume.
22-
dbms.memory.transaction.max_size=6g
22+
dbms.memory.transaction.max_size=6g
23+
24+
# Transaction: Retention policy for transaction logs needed to perform recovery and backups.
25+
dbms.tx_log.rotation.retention_policy=keep_none

scripts/configuration/template-neo4j.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ server.jvm.additional=-XX:+ExitOnOutOfMemoryError
1919
db.memory.transaction.total.max=6g
2020

2121
# Memory: Limit the amount of memory that a single transaction can consume.
22-
db.memory.transaction.max=6g
22+
db.memory.transaction.max=6g
23+
24+
# Transaction: Retention policy for transaction logs needed to perform recovery and backups.
25+
db.tx_log.rotation.retention_policy=keep_none

scripts/setupNeo4j.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ if [ ! -d "${NEO4J_INSTALLATION_DIRECTORY}" ] ; then
9898
echo "setupNeo4j: Commenting out configuration properties that will later be replaced or are not needed"
9999
if [[ "$NEO4J_MAJOR_VERSION_NUMBER" -ge 5 ]]; then
100100
sed -i.backup '/^server\.directories\.import=/ s/^/# defined in the directory section further below #/' "${NEO4J_CONFIG}"
101+
sed -i.backup '/^db\.tx_log\.rotation\.retention_policy=/ s/^/# defined in the transaction section further below #/' "${NEO4J_CONFIG}"
101102
else
102103
sed -i.backup '/^dbms\.directories\.import=/ s/^/# defined in the directory section further below #/' "${NEO4J_CONFIG}"
104+
sed -i.backup '/^dbms\.tx_log\.rotation\.retention_policy=/ s/^/# defined in the transaction section further below #/' "${NEO4J_CONFIG}"
103105
fi
104106
# Remove the backup file
105107
rm -f "${NEO4J_CONFIG}.backup"
@@ -161,7 +163,7 @@ if [ ! -d "${NEO4J_INSTALLATION_DIRECTORY}" ] ; then
161163
} >> "${NEO4J_CONFIG}"
162164
fi
163165

164-
echo "setupNeo4j: Configuring static settings (memory, procedure permittions, ...)"
166+
echo "setupNeo4j: Configuring static settings (memory, procedure permissions, ...)"
165167
if [[ "$NEO4J_MAJOR_VERSION_NUMBER" -ge 5 ]]; then
166168
cat "${SCRIPTS_DIR}/configuration/template-neo4j.conf" >> "${NEO4J_CONFIG}"
167169
else

0 commit comments

Comments
 (0)