Maildir on ZFS

Ronald Klop ronald-lists at klop.ws
Sat Aug 29 08:46:54 UTC 2020


On Sat, 29 Aug 2020 00:03:12 +0200, Mason Loring Bliss <mason at blisses.org>  
wrote:

> I sent this to BSD Now a month ago and haven't heard anything back, but I
> bet there are opinions to be had in here! Thanks in advance.
>
>
>
> I'm migrating a mail server to a FreeBSD jail, and I've seen conflicting
> notes about how best to tune ZFS for holding accounts with Maildirs. My
> current thinking is that I don't want to change recordsize as it's an  
> upper
> limit, not a minimum, but that I might want to set primarycache=metadata  
> so
> I'm caching information about Maildir contents, but not the Maildir
> contents themselves. But are these valid thoughts, and what else is there
> to think about? The problem is that I don't know what I don't know, and  
> I'm
> not sure about what I do know, so I'd love some advise about how best to
> tune a dataset for Maildirs.
>
> Thanks!
>


It depends on the clients also. Do they retrieve mail once, store it  
locally and only check the server for updates, than metadata might be  
enough, but if it is mostly webmail clients which retrieves the same mail  
multiple times, than caching data is probably beneficial.
But it also depends on the amount of data you store on what medium  
(HDD/SSD/RAID) and how much memory your server has. As you don't specify a  
lot of information about the specifics it is hard to say. Is NFS involved  
or just ZFS?
NB: Maildir is very (Z)FS friendly by having a lot of static data on disk.  
Dovecot creates some indices for fast retrieval of metadata. You can store  
these indices on tmpfs also or on another volume/dataset with other  
primarycache settings.


The other advice is: test your own system. In the other reply I saw advice  
about how to look at cache statistics. ZFS is very fast without tuning  
already.

Regards,
Ronald.


More information about the freebsd-fs mailing list