Diagnosing Neo4j Transaction Log Growth Leading to Disk Full on a Standalone Instance
Step‑by‑step guide to diagnose and resolve Neo4j transaction log growth that fills disk on a standalone instance, including checks, fixes, and verification.
25 Mar 2026, 09:16 UTC

Recognizable Condition
Neo4j repeatedly logs warnings like WARN: Transaction log file size exceeded threshold. The file /var/lib/neo4j/data/databases/graph.db/transaction.log grows beyond the size set by dbms.tx_log.rotation.size. Monitoring shows the disk partition holding the Neo4j data directory nearing 100 % utilization, and application clients see increased latency or timeouts because Neo4j blocks new transactions while waiting for log space.
Common Causes
| Cause | Explanation |
|---|---|
| Misconfigured log rotation | dbms.tx_log.rotation.retention_policy set to size with a high limit or disabled, so logs are not pruned. |
| Long‑running transactions | Open transactions prevent the log file from being rotated or deleted, keeping the file open and growing. |
| Insufficient page cache | Low dbms.memory.pagecache.size forces frequent checkpoints that keep log files open. |
| Backup process holding locks | An online backup (e.g., neo4j-admin dump) retains a lock on log files, blocking rotation. |
Ordered Diagnostic Checks
- Check log warnings – On the Neo4j host, run:
Record timestamps and note the size ofgrep 'Transaction log file size exceeded threshold' /var/lib/neo4j/log/neo4j.debug.logtransaction.logwith:
(requires read permission on the neo4j logs directory).ls -lh /var/lib/neo4j/data/databases/graph.db/transaction.log - Verify rotation settings – Inside Neo4j Browser or via cypher-shell execute:
Note the current values; default retention policy isCALL dbms.listConfig() YIELD name, value WHERE name IN ('dbms.tx_log.rotation.retention_policy','dbms.tx_log.rotation.size') RETURN name, value;sizeand default size is100M. - Identify long‑running transactions – Run:
Any transaction running for minutes or hours is a suspect.CALL dbms.listTransactions() YIELD transactionId, startTime, status WHERE status = 'RUNNING' RETURN transactionId, startTime; - Check page cache usage – Look at:
and compareCALL dbms.query('CALL dbms.component() YIELD name, versions, edition RETURN name')dbms.memory.pagecache.sizeinneo4j.confwith the server’s RAM; a rule of thumb is to allocate 50‑70 % of RAM to page cache. - Inspect backup locks – If you run scheduled backups, verify they are not active during the growth period by checking backup logs or running:
while the warning appears.ps -ef | grep neo4j-admin
Fixes Tied to Findings
| Finding | Corrective Action |
|---|---|
Rotation policy set to size with a limit far above actual needs or disabled | Edit /etc/neo4j/neo4j.conf (or the config directory used by your installation) and set:
|
| Long‑running transactions blocking rotation | Identify the application or query causing the transaction and either:
|
| Page cache too small causing frequent checkpoints | Increase dbms.memory.pagecache.size (e.g., to 4G on a 8 GB RAM host) in neo4j.conf and restart. |
| Backup process holding locks | Schedule backups during low‑traffic windows or use neo4j-admin dump --force which releases the lock sooner. Ensure the backup script does not leave a hanging process. |
Escalation Criteria
- Disk usage remains above 90 % after applying the above fixes and restarting Neo4j.
- Log file continues to grow despite correct rotation settings and no long‑running transactions.
- Neo4j fails to start after a configuration change, indicating possible store corruption.
- Application experiences persistent timeouts (>30 s) even after log space is freed.
If any of these occur, collect:
- A full copy of
/var/lib/neo4j/log/neo4j.debug.logandneo4j.log. - The output of
neo4j-admin info. - A recent backup of the graph store (if available).
- Then open a support ticket with Neo4j or consult the Neo4j Operations Manual for store recovery procedures.
Verification After Fix
After restarting Neo4j with the corrected settings:
- Confirm the rotation settings are active:
CALL dbms.listConfig() YIELD name, value WHERE name = 'dbms.tx_log.rotation.size' RETURN name, value; - Monitor the transaction log size for a few cycles (e.g., every 5 minutes) with:
You should see the file size reset to roughly the configuredwatch -n 300 ls -lh /var/lib/neo4j/data/databases/graph.db/transaction.logdbms.tx_log.rotation.sizeafter each rotation. - Check that no new
WARN: Transaction log file size exceeded thresholdlines appear inneo4j.debug.log.
Limitations and Practical Check
Changing rotation parameters requires a Neo4j restart; during the restart the database is unavailable. Plan the restart within a maintenance window or use a clustered setup for zero‑downtime upgrades. The verification step above assumes you have shell access to the Neo4j host and permission to run ls and Neo4j cypher commands. If you cannot restart immediately, you can temporarily mitigate growth by killing long‑running transactions (via CALL dbms.killTransaction($id) YIELD success RETURN success) but this may roll back work and should be used only as a short‑term measure.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.