[Dovecot] Question about Dovecot and NFS
Hi,
We are using mbox and UW IMAP, and are having issues because UW IMAP does not support multiple client access when you use NFS for the mail files. I've done some research (see the comments after my 2 questions below), and most of the other major IMAP servers simply don't support it (courier is about the only one that has a positive comment).
How much testing have you done w/NFS-mounted mail in mbox format? Have you found a reliable way to handle NFS mbox files?
The UW IMAP docs say that multiple client access to mail spools that are NFS mounted is not safe, and the source has comments like this about NFS mail spools:
/* Make fcntl() locking of NFS files be a no-op the way it is with flock()
- on BSD. This is because the rpc.statd/rpc.lockd daemons don't work very
- well and cause cluster-wide hangs if you exercise them at all. The
- result of this is that you lose the ability to detect shared mail_open()
- on NFS-mounted files. If you are wise, you'll use IMAP instead of NFS
- for mail files.
- Sun alleges that it doesn't matter, because they say they have fixed all
- the rpc.statd/rpc.lockd bugs. This is absolutely not true; huge amounts
- of user and support time have been wasted in cluster-wide hangs. */
Cyrus' FAQ says this about NFS mail spools: (http://asg.web.cmu.edu/cyrus/imapd/install-FAQ.html#nfs)
NFS (don't)
Q: Weird things are happening. The mailspool is mounted over NFS, and...
A: Don't mount the mail spool over NFS. Due to locking problems with NFS, this doesn't work (and for various other reasons, probably isn't worth the bother; IMAP appears to be I/O bound, not CPU bound, and scaling in this way is not a good idea).
More specifically, if you use NFS and it looks to work, you may have locking problems in the future which will result in silently lost mail.
If you use NFS and things go berzerk, it's because mmap(2) apparently has different semantics on local disk than it has on NFS. You can get the above behavior (silently lost mail) if you work at it.
Courier is the only one that seems friendly (excerpt from their web site):
Courier-IMAP is popular on Qmail/Exim/Postfix sites that are configured to use maildirs. The primary advantage of maildirs is that multiple applications can access the same Maildir simultaneously without requiring any kind of locking whatsoever. Maildir is a faster and more efficient way to store mail. It works particularly well over NFS, which has a long history of locking-related woes.
-- Anthony Kay University Computing Center (541) 346-1719 GPG Fingerprint: B0DB D46A 60AF FAE7 A94A 5075 0CB4 4D88 9F4F 7F09
When they discover the center of the universe, a lot of people will be disappointed to discover they are not it.
Bernard Bailey
Tony Kay wrote:
Courier is the only one that seems friendly (excerpt from their web site):
Courier-IMAP is popular on Qmail/Exim/Postfix sites that are configured to use maildirs. The primary advantage of maildirs is that multiple applications can access the same Maildir simultaneously without requiring any kind of locking whatsoever. Maildir is a faster and more efficient way to store mail. It works particularly well over NFS, which has a long history of locking-related woes.
Please note that this is in reference to Maildir NOT in reference to mbox format mail stores.
Leeman
On Mon, 2006-01-30 at 11:50 -0800, Tony Kay wrote:
Hi,
We are using mbox and UW IMAP, and are having issues because UW IMAP does not support multiple client access when you use NFS for the mail files. I've done some research (see the comments after my 2 questions below), and most of the other major IMAP servers simply don't support it (courier is about the only one that has a positive comment).
How much testing have you done w/NFS-mounted mail in mbox format? Have you found a reliable way to handle NFS mbox files?
Dovecot allows you to configure how to do locking for mbox files, so if you're confident enough in your NFS lockd daemon you can just use it.
But I think using dotlocks for reading should work well enough too. Only problem it causes is that if a client is reading one large mail for a long time, other clients/connections can't read the mbox at the same time. Probably doesn't matter much.
Dovecot's indexes currently don't behave perfectly with NFS, so it might be better idea to store them locally (especially if all IMAP access goes through one computer). Although I'm going to fix that soon too..
participants (3)
-
Leeman Strout
-
Timo Sirainen
-
Tony Kay