[Dovecot] Dovecot never release preallocated space in mdbox

Timo Sirainen tss at iki.fi
Fri Aug 2 15:30:58 EEST 2013


On Mon, 2013-07-29 at 11:48 +0200, Stéphane BERTHELOT wrote:

> mdbox_rotate_size = 128M
> mdbox_rotate_interval = 1d
> mdbox_preallocate_space = yes
> with virtual users and location like :
> mail_location = mdbox:~/mdbox
> 
> I don't think the remaining config is relevant but ask me if you need 
> some other parts.
> 
> Using test accounts for 2 weeks now I've figured that the 128M 
> preallocated space is never 'hole punched" (to use a similar term than 
> "man fallocate" on Linux), even when rotating m.* files.

Yeah, those settings weren't really intended to be used together.

> There would certainly be smart to use something similar to 
> "FALLOC_FL_PUNCH_HOLE" on rotation (when doing close() ?) so that when 
> we're sure there won't be anymore data appended to file that the 
> allocated space == used space.

The problem is that there is no "rotation time". In normal operation
Dovecot would be wasting time (=disk IO) looking at old files and
figuring out if they would need hole punching. I guess the doveadm purge
job could do that, but I'm not sure if that's always the best idea
either. I remember some people using different mdbox settings for normal
operations and for doveadm purge runs, so this could also
unintentionally break things..




More information about the dovecot mailing list