[Imap-use] Re: imap-uw on FreeBSD 6.2
Mark Crispin
mrc at CAC.Washington.EDU
Thu Mar 15 15:28:35 UTC 2007
On Thu, 15 Mar 2007, Willy Offermans wrote:
> On Thu, Mar 15, 2007 at 12:29:48PM +0100, Václav Haisman wrote:
>> I advise you against using IMAP UW, unless you know your mailboxes won't
>> grow beyond just few megabytes or that there will be only few of them.
>> Their reading and rewriting of whenever you make changes can stress
>> server quite a lot.
The problem with taking advice from a sorcerer's apprentice is that often
the advice is only half-right, or based upon incomplete knowledge.
The large I/O situation described by Václav Haisman is indeed a
characteristic of the 1970s vintage traditional UNIX mailbox format which
is the default mailbox format in UW imapd.
The traditional UNIX mailbox format requires that the program using it
read every byte of the mailbox in order to locate the "From " internal
header line, and thus to locate and identify messages.
The traditional UNIX mailbox format requires that message metadata as
variable-length lines in the message headers. Alteration of that metadata
often requires rewriting the remainder of the file as data is slid up or
down. I say "often", since UW imapd insert a modest amount of padding
data so that some alterations can be done that only require rewriting the
message data and nothing else.
Another problem, endemic to all flat file mailbox formats, is that an
expunge operation also requires sliding down subsequent messages on top of
the message being expunged.
However, please note that these are characteristics of a mailbox FORMAT,
and not of the IMAP server software. UW imapd supports several mailbox
formats, most notably:
. The mbx mailbox format is a flat file format with preallocated message
metadata and message pointers. The read-every-byte open of traditional
UNIX mailbox format becomes a per-message seek and 64 byte read in mbx
format. mbx was a great choice in the mid 1990s when it was designed,
but it has gotten long in the tooth.
. The new mix format is an indexed format in which all the message
metadata is stored and maintained in a separate index. Opens are 1
to 2 orders of magnitude faster than mbx, which in turn is faster than
traditional UNIX. Messages are distributed into multiple data files,
so there are no large files. Mix is the format that large sites in
the UW imapd community have either deployed or are moving to deploy.
What this all means is that, yes, switching your IMAP server to another
server will probably help your performance -- because that other IMAP
server will change your mailbox format to something else!
You can, however, change your mailbox format to something else in UW imapd
without switching your IMAP server, and achieve the same benefit.
Traditional UNIX format is the UW imapd default -- UW imapd pays
considerable attention to compatibility and interoperability with existing
legacy services -- but most UW imapd sites quickly switch formats to a
newer technology format.
This is what I meant by "half-right advice and incomplete knowledge."
Your performance problem is due to mailbox format, not the server
software. Change your mailbox format, and your problems will be solved
(at least until your usage grows to fill the greater capacity provided by
the new mailbox format...).
If you do decide to switch servers anyway, the two competing servers which
you should consider are Cyrus and Dovecot. The developers of those
servers are active participants in the IMAP protocol standards community,
and all of us (UW, Cyrus, Dovecot) talk with each other and go to
considerable effort to make our respective implementations interoperable
and compliant. I will leave it to the Cyrus and Dovecot folks to toot
their own horns.
-- Mark --
http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
More information about the freebsd-stable
mailing list