How often does logrotate run, and why does `maxsize` sometimes not trigger in time?
IntermediateProductionLogs, Limits & High-Traffic Tuning
Answer
logrotate is run once a day by logrotate.timer (systemd) or /etc/cron.daily/logrotate. Size options are only evaluated when it runs, so a log can grow far past maxsize between runs. For chatty services, run logrotate hourly for that config (a dedicated timer calling logrotate /etc/logrotate.d/app with its own state file -s), and set hourly in the config, or fix verbosity at the source.
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 do you limit journald disk usage?Intermediate