]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Rotate dovecot.list.index.log* more often.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 23 Nov 2016 21:19:05 +0000 (23:19 +0200)
committerGitLab <gitlab@git.dovecot.net>
Thu, 24 Nov 2016 21:13:30 +0000 (23:13 +0200)
The history in these files isn't as important as in mailbox indexes.
Reduce disk space usage by rotating them more often and deleting the
.log.2 more quickly.

src/lib-storage/list/mailbox-list-index.c

index 8217ff334c56edf7a9b5b7c00d57e0f284d49fc3..d63afb1c4ab90ec824355cba1b4ee15d9e55b927 100644 (file)
 
 #define MAILBOX_LIST_INDEX_REFRESH_DELAY_MSECS 1000
 
+/* dovecot.list.index.log doesn't have to be kept for that long. */
+#define MAILBOX_LIST_INDEX_LOG_ROTATE_MIN_SIZE (8*1024)
+#define MAILBOX_LIST_INDEX_LOG_ROTATE_MAX_SIZE (64*1024)
+#define MAILBOX_LIST_INDEX_LOG_ROTATE_SECS_AGO (5*60)
+#define MAILBOX_LIST_INDEX_LOG2_STALE_SECS (10*60)
+
 static void mailbox_list_index_init_finish(struct mailbox_list *list);
 
 struct mailbox_list_index_module mailbox_list_index_module =
@@ -73,6 +79,11 @@ int mailbox_list_index_index_open(struct mailbox_list *list)
        mail_index_set_permissions(ilist->index, perm.file_create_mode,
                                   perm.file_create_gid,
                                   perm.file_create_gid_origin);
+       mail_index_set_log_rotation(ilist->index,
+                                   MAILBOX_LIST_INDEX_LOG_ROTATE_MIN_SIZE,
+                                   MAILBOX_LIST_INDEX_LOG_ROTATE_MAX_SIZE,
+                                   MAILBOX_LIST_INDEX_LOG_ROTATE_SECS_AGO,
+                                   MAILBOX_LIST_INDEX_LOG2_STALE_SECS);
 
        mail_index_set_fsync_mode(ilist->index, set->parsed_fsync_mode, 0);
        mail_index_set_lock_method(ilist->index, set->parsed_lock_method,