Skip to content

Commit

Permalink
lib-storage: Rotate dovecot.list.index.log* more often.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen committed Nov 25, 2016
1 parent 39815e8 commit 0882459
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib-storage/list/mailbox-list-index.c
Expand Up @@ -12,6 +12,12 @@

#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 =
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0882459

Please sign in to comment.