Interview Prep/Linux/Logs, Limits & High-Traffic Tuning

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.

All Linux questions Roadmap: Linux

More on Logs, Limits & High-Traffic Tuning