[Dovecot] So, what about clustering and load balancing?

Eric Rostetter rostetter at mail.utexas.edu
Sun Feb 14 07:02:45 EET 2010

Quoting Stan Hoeppner <stan at hardwarefreak.com>:

> Eric Rostetter put forth on 2/13/2010 8:39 PM:
>> This ignores the delivery of mail to the user (again, not so bad for
>> maildir
>> but a killer for mbox).  If the delivery is on a separate box than dovecot
>> your can have lock contention...
> You attach the inbound MTA to the FC switch, export the LUN with the GFS2
> filesystem and drop new mail to the appropirate folder(s).

Which is the same folder/file the imap reads.  So you have the MTA delivering
to the folder/file, and the dovecot server accessing the same, and hence
you have lock contention.

> The dovecot cluster
> machines pick it up just as if it were on a local filesystem.  This  
> can be done
> very easily with with mbox or maildir and there's no more potential for lock
> contention than the imap files.

If the MTA is delivering to an mbox file, and dovecot is reading/writing
to the same mbox file, and the MTA and dovecot are on different machines,
then you DO have lock contention.  For maildir, less so (to the point
it is negligible and not worth talking about really).

>> Also there may be other things to cause lock contention like backups,
>> admin cron jobs to check things, etc.
> You have all these things with a non clustered filesystem and have  
> to deal with
> them there anyway, so there's really no difference is there?

No, to really...

>> Anyway, I run dovecot in a cluster without any issue, but that is because
>> of my client base and performance expectations (and some real nice
>> hardware).
> Tell us more about your hardware setup if you don't mind.

See the archives for details...  Basically a 3 node cluster doing GFS
over DRDB on 2 nodes in an active-active setup..  Those two nodes do MTA and
dovecot (with DRBD+GFS), the 3rd does webmail only (without DRBD/GFS).
They hold only the INBOX mbox files, not the other folders which are
in the user's home directory.  Home directories are stored on a separate
2-node cluster running DRBD in an active-passive setup using ext3.
The mail servers are front-ended by a 2-node active-passive cluster
(shared nothing) which directs all MTA/dovecot/httpd/etc traffic.  I
use perdition to do dovecot routing via LDAP, the MTA can also do routing
via LDAP, and I use pound to do httpd routing.

Right now it is just a few nodes, but it can grow if needed to really any
number of nodes (using GNBD to scale the GFS where needed, and the
MTA/Dovecot/httpd routing already in place).  Right now, it rocks, and
the only thing we plan to scale out is the webmail part (which is easy
as it doesn't involve any drbd/gfs/mta/dovecot, just httpd and sql).

> Also, when do you plan to move to GFS2?

Sorry, it is GFS2...  Has been since I set it up...  In fact, we delayed
the project until GFS2 was available (I think it was like 6 months or

> Thanks.
> --
> Stan

Eric Rostetter
The Department of Physics
The University of Texas at Austin

Go Longhorns!

More information about the dovecot mailing list