Bottom line: Journald without limits grows until the disk fills, and SystemMaxUse is the only thing stopping it. Set a ceiling, set rate limiting, and keep persistent storage — a volatile journal loses the evidence exactly when a machine crashes.

The limits

1
2
3
4
5
6
7
8
# /etc/systemd/journald.conf
Storage=persistent
SystemMaxUse=1G
SystemMaxFileSize=100M
SystemKeepFree=2G
RuntimeMaxUse=200M
RateLimitIntervalSec=30s
RateLimitBurst=5000

SystemKeepFree is the one that saves a nearly-full disk: journald shrinks below the limit to keep 2 GB free.

Why persistent

Storage=volatile writes to /run and vanishes on reboot, so the crash you need to diagnose is the one whose log is gone. Persistent survives and is bounded by the limits above.

Rate limiting matters

A service logging in a loop fills 1 GB in minutes. The defaults (10,000 per 30 s) are too generous; 5,000 per 30 s with a note in the config is usually right. Suppressed messages are counted and reported, so nothing is silently lost.

Querying efficiently

1
2
3
journalctl -u nginx --since "1 hour ago" -p err
journalctl --disk-usage
journalctl --vacuum-time=14d

--vacuum-time is the manual prune; the config limits prune automatically. Do both — the config prevents growth, the vacuum clears an already-bloated journal.

What to forward off-box

Any log that matters for incidents: auth failures, OOM kills, disk errors. A 100-line journalctl tail shipped to a chat webhook or syslog is 30 lines of config and survives lost hardware.

Verify

1
2
du -sh /var/log/journal
journalctl --disk-usage

Under the configured SystemMaxUse and shrinking after a spike. A journal that ignores its own limit means the config file has a syntax error and journald silently kept defaults.

Operating notes

SystemMaxUse is the only thing that stops the disk filling. Pair it with SystemKeepFree so a nearly-full disk gets shaved automatically.

1
2
3
4
5
Storage=persistent
SystemMaxUse=1G
SystemKeepFree=2G
RateLimitIntervalSec=30s
RateLimitBurst=5000

Persistent, not volatile

Storage=volatile writes to /run and vanishes on reboot — the crash you need to diagnose is the one whose log is gone.

Rate limiting

A service logging in a loop fills 1 GB in minutes. 5,000 per 30 s instead of the 10,000 default; suppressed lines are counted, so nothing is lost silently.

Verify

journalctl --disk-usage under the configured cap and shrinking after a spike. A journal ignoring its own limit means a syntax error in the config and defaults kept running.

FAQ

What is the bottom line on journald disk usage?

Journald without limits grows until the disk fills, and SystemMaxUse is the only thing stopping it. Set a ceiling, set rate limiting, and keep persistent storage. A volatile journal loses the evidence exactly when a machine crashes.

Why does Storage=volatile lose logs on reboot?

Storage=volatile writes to /run, which vanishes on reboot. That means the crash you need to diagnose is the one whose log is gone. Persistent storage survives reboots and is still bounded by the configured limits.

How do I stop a service that logs in a loop from filling the disk?

Rate limiting is the control for this. A service logging in a loop fills 1 GB in minutes, and the defaults of 10,000 per 30 seconds are too generous. Setting RateLimitBurst=5000 with RateLimitIntervalSec=30s is usually right, and suppressed messages are counted and reported so nothing is silently lost.

What does SystemKeepFree do on a nearly full disk?

SystemKeepFree is the setting that saves a nearly-full disk: journald shrinks below the limit to keep the specified amount free. Pair it with SystemMaxUse so a nearly-full disk gets shaved automatically rather than filling completely.

Why does my journal ignore its configured limit?

A journal that ignores its own limit means the config file has a syntax error and journald silently kept the defaults. Verify with journalctl --disk-usage and du -sh /var/log/journal: usage should sit under the configured SystemMaxUse and shrink after a spike.