Skip to content

Commit

Permalink
Merge pull request #294 from JohT/feature/minimize-neo4j-transaction-…
Browse files Browse the repository at this point in the history
…log-disk-space

Minimize Neo4j transaction log disk space utilization
  • Loading branch information
JohT authored Dec 22, 2024
2 parents 7426d70 + 8b34b4d commit 6a10476
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion graph-visualization/renderVisualizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ let browser;
"--disable-component-extensions-with-background-pages",
"--disable-client-side-phishing-detection",
"--use-gl=disabled",
"--disable-features=Vulkan",
"--disable-features=Vulkan",
"--no-sandbox" // See https://pptr.dev/troubleshooting#issues-with-apparmor-on-ubuntu
],
}); // { headless: false } for testing

Expand Down
5 changes: 4 additions & 1 deletion scripts/configuration/template-neo4j-v4.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ dbms.jvm.additional=-XX:+ExitOnOutOfMemoryError
dbms.memory.transaction.global_max_size=6g

# Memory: Limit the amount of memory that a single transaction can consume.
dbms.memory.transaction.max_size=6g
dbms.memory.transaction.max_size=6g

# Transaction: Retention policy for transaction logs needed to perform recovery and backups.
dbms.tx_log.rotation.retention_policy=keep_none
5 changes: 4 additions & 1 deletion scripts/configuration/template-neo4j.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ server.jvm.additional=-XX:+ExitOnOutOfMemoryError
db.memory.transaction.total.max=6g

# Memory: Limit the amount of memory that a single transaction can consume.
db.memory.transaction.max=6g
db.memory.transaction.max=6g

# Transaction: Retention policy for transaction logs needed to perform recovery and backups.
db.tx_log.rotation.retention_policy=keep_none
4 changes: 3 additions & 1 deletion scripts/setupNeo4j.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ if [ ! -d "${NEO4J_INSTALLATION_DIRECTORY}" ] ; then
echo "setupNeo4j: Commenting out configuration properties that will later be replaced or are not needed"
if [[ "$NEO4J_MAJOR_VERSION_NUMBER" -ge 5 ]]; then
sed -i.backup '/^server\.directories\.import=/ s/^/# defined in the directory section further below #/' "${NEO4J_CONFIG}"
sed -i.backup '/^db\.tx_log\.rotation\.retention_policy=/ s/^/# defined in the transaction section further below #/' "${NEO4J_CONFIG}"
else
sed -i.backup '/^dbms\.directories\.import=/ s/^/# defined in the directory section further below #/' "${NEO4J_CONFIG}"
sed -i.backup '/^dbms\.tx_log\.rotation\.retention_policy=/ s/^/# defined in the transaction section further below #/' "${NEO4J_CONFIG}"
fi
# Remove the backup file
rm -f "${NEO4J_CONFIG}.backup"
Expand Down Expand Up @@ -161,7 +163,7 @@ if [ ! -d "${NEO4J_INSTALLATION_DIRECTORY}" ] ; then
} >> "${NEO4J_CONFIG}"
fi

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

0 comments on commit 6a10476

Please sign in to comment.