Log rotation

Even though some arguments in favor of log rotation imply that maintaining smaller files increases writing performance, the size of a file doesn’t affect its writing performance.

The reason is that in most modern filesystem implementations, the kernel knows the size of a file, and appending data can happen after performing a seek syscall to position the pointer at the end of the file which is a constant time operation.

[4] It has the ability to trigger rotation based on file size, time or interval (or any combination thereof).

The command is often run as a cron job, which has the effect of fully automatic log rotation.

Old logfiles whose number exceeds a threshold can then be deleted or archived off-line to save space.