[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Imap troubles

On Tue, 20 Nov 2001, Matthew Daubenspeck wrote:

> We all know that the standard IMAPD is really too slow. I am planning on
> switching to something more effective. Reading webmail and such is quite a
> painstaking process with anything more then 30 messages in a folder.

I noticed this unfounded assertion in the last thread but never got around
it to respond to it.  The problem is not IMAP or POP3 or particular
implementations thereof but the standard Unix mbox format.  In this
format, a mail folder = a file and the entire thing has to be read into
memory.  If you have huge mail folders and not enough memory -- that's
when you start seeing the slowdown.

There are two alternatives which have advantages and disadvantages.

1.  Store each mail as a seperate file.

This is the approach taken by the maildir format courier uses.  (Debians'
uw-imapd also has maildir support.)  This makes common mail operations
like opening a message or checking for new mail fast but causes a lot more
disk access.  Performence also gets worse the more messages (files) you

2.  Use some kind of indexing scheme

This could either be a full blown database or some kind of hashing scheme.
Cyrus uses the latter iirc.  The benefit is that access time to any
particular message is constant no matter how many messages you have in a
folder.  The downside is tools (MDA etc.) must specifically be designed to
support the db format and if for some reason the db is corrupted, you
lose access to the mail.

Any kind of blanket statement that one format is "better" than the other
is pointless and stupid.  You need to do some research and benchmarking
considering factors such as usage patterns, memory, disk space, disk
speed, bandwith and interoperability to determine what's right for your

Jaldhar H. Vyas <jaldhar@debian.org>

Reply to: