12 MB threshold for rename versus truncate

This commit is contained in:
Oliver Gorwits
2015-01-24 21:01:47 +00:00
parent 8305f9bf0b
commit f4f955885d
2 changed files with 6 additions and 4 deletions

View File

@@ -169,8 +169,9 @@ sub rotate_logs {
}
# if the log file's about 10M then the race condition in copy/truncate
# has a low probability. if the file's larger, then we rename and kill
if ((-s $log_file) > (15 * 1024768)) {
# has a low risk of data loss. if the file's larger, then we rename and
# kill.
if ((-s $log_file) > (12 * 1024768)) {
rename $log_file, $log_file .'.1';
signal_child('HUP', $child);
}