summaryrefslogtreecommitdiffstats
path: root/doc/wiki/MailLocation.LocalDisk.txt
blob: 4bd99fe2a551d3b828727898370c6d0061ab2293 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Mail storage in local disk
==========================

Filesystems
-----------

 * See <MailboxFormat.Maildir.txt> for Maildir-specific filesystem
   optimizations
 * Dovecot doesn't rely on atime updates, so you can mount the filesystem with
   noatime

Index files
-----------

Keeping index files on a different disk than the mail spool gives you better
performance. The indexes have a lot of write activity so it is recommended to
use RAID-10 instead of RAID-5 for them.

Fsyncing
--------

By default Dovecot calls fsync() and fdatasync() whenever it's useful to
prevent potential data loss. The main reason for this is so that Dovecot won't
lie that the message was saved to the disk, if in fact a power failure a second
later would lose the message. With IMAP clients this is perhaps a less serious
problem, because the lost message was most likely either a mail in Draft
mailbox or a message in "Sent Messages" mailbox. In any case a message that the
user had already seen. However if <LDA.txt> loses a message, the user never
even knew that the message existed, unless the sender decides to resend it.

Since power failures and kernel panics are quite rare, many people are tempted
to disable fsyncing because it may increase the performance quite a lot.
Dovecot allows this by setting 'mail_fsync=never'. However you should consider
leaving it at "optimized" for LDA and LMTP. You can do this with:

---%<-------------------------------------------------------------------------
# Default to no fsyncing
mail_fsync = never

protocol lda {
  # Enable fsyncing for LDA
  mail_fsync = optimized
}
protocol lmtp {
  # Enable fsyncing for LMTP
  mail_fsync = optimized
}
---%<-------------------------------------------------------------------------

(This file was created from the wiki on 2019-06-19 12:42)