How do you limit journald disk usage?
IntermediateProductionLogs, Limits & High-Traffic Tuning
Answer
# /etc/systemd/journald.conf.d/size.conf
[Journal]
SystemMaxUse=2G
SystemKeepFree=4G
MaxRetentionSec=14day
RateLimitIntervalSec=30s
RateLimitBurst=10000
sudo systemctl restart systemd-journald
journalctl --disk-usage
sudo journalctl --vacuum-size=1G
More on Logs, Limits & High-Traffic Tuning
How does log management work on a modern Linux server?BeginnerWhy centralize logs instead of reading them on each server?BeginnerWrite a logrotate config for an application log.BeginnerWhat is the difference between `copytruncate` and `create` + postrotate signal?IntermediateLogs rotated but disk usage did not drop. Why?IntermediateHow often does logrotate run, and why does `maxsize` sometimes not trigger in time?Intermediate