Mail storage in shared disks ============================ Dovecot supports keeping mails and index files in clustered filesystems, such as Red Hat GFS [http://www.redhat.com/software/rha/gfs/], Oracle OCFS2 [http://oss.oracle.com/projects/ocfs2/] and Polyserve Matrix [http://www.polyserve.com/matrix_server_linux.php]. Dovecot also supports keeping mails and index files in NFS. Everything described in this page applies to NFS as well, but see<NFS.txt> for more NFS-specific problems and optimizations. Memory mapping -------------- By default Dovecot mmap()s the index files. This may not work with all clustered filesystems, and it most certainly won't work with NFS. Setting 'mmap_disable = yes' disables mmap() and Dovecot does its own internal caching. If mmap() is supported by your filesystem, it's still not certain that it gives better performance. Try benchmarking to make sure. Locking ------- Dovecot supports locking index files with fcntl (default), flock or dotlocks. Some clustered filesystems may not support fcntl, so you can change it to use flock instead. Fcntl locks may also cause problems with some NFS configurations, in which case you can try if switching to dotlocks helps. Note that dotlocks are the slowest locking method. You can change the lock method from 'lock_method' setting. Regardless of the 'lock_method' setting, Dovecot always uses dotlocks for some locks. Because of this, setting 'dotlock_use_excl=yes' will also improve the performance. Before doing that with NFS, make sure that your NFS client and server support O_EXCL. Clock synchronization --------------------- Run ntpd in each computer to make sure their clocks are synchronized. If the clocks are more than one second apart from each others and multiple computers access the same mailbox simultaneously, you may get errors. Caching ------- Your cluster will probably perform better if users are usually redirected to the same server. This is because the mailbox may already be cached in the memory and it may also reduce the traffic between the clusterfs nodes. At the very least make sure that the concurrent connections coming for the user from the same IP address go to the same server. (This file was created from the wiki on 2007-06-15 04:42)