[Dovecot] Concurrent dovecot instances on same spool?

Nick Warr nick at mobilia.it
Tue Mar 6 10:24:59 EET 2012


Il 05/03/2012 18.53, Timo Sirainen ha scritto:
> On 5.3.2012, at 19.25, Jacek Osiecki wrote:
>
>>>> However, if we have everything redundant, why not have the same with SMTP
>>>> and POP3/IMAP? But - won't anything fail if two (or more) dovecots are
>>>> accessing the same disk space, both for IMAP/POP3 and LDA/LMTP?
>>> If both servers randomly access users' mails, with NFS you'll have some
>>> trouble, with OCFS2 probably less trouble. But in both cases you'll have
>>> better performance and no problems if you use Dovecot director in both
>>> servers (install both director and backend to both servers).
>>> http://wiki2.dovecot.org/Director
>> Thanks, I'll probably give it a try. On the other hand, it would be nice to have a possibility to allow multiple dovecot instances to access mail spool (at cost of handling some extra file/directory locks) - a bit slower, but safe...
> You can safely do that with director.
>
> Also the problem with NFS isn't locks, but caching.

After reading a little bit, it seems that Director does the job of a 
decent load balancer, but in the middle instead of in front of your 
servers, I've limited problems with NFS by using "sticky" connections 
with long timeouts in my load balancer, unless they're disconnected for 
days, they'll always end up going through the same server for POP3/IMAP 
conections. Doesn't work great for the SMTP/LDA part though.
>
>> Another question: as I assume, when you wrote about troubles it was applying to IMAP. How about LMTP/LDA? Can anything bad happen when one mailbox is being filled by LMTP/LDA from more than one server)?
> Yes, because they're still updating Dovecot index files. You could disable LMTP/LDA index updates, but I'm still not sure if it works 100% correctly (because dovecot-uidlist is appended to).
>
In the rare case it does happen, NFS locking and concurrent_connections 
set to one has seemed to reduce my problems to a minimum..

I like the Director idea though, since it's content aware it isn't 
organizing connections based on port/IP, but on the the actual users, 
especially if it does so with the LDA, it seems like an excellent 
solution to collisions (I guess they're called this) ..

I wish it had been a reality when I was building my servers.



More information about the dovecot mailing list