On Sun, 2011-01-16 at 00:05 -0600, Stan Hoeppner wrote:
Using O_DIRECT with mbox files, the IOPS performance can be even greater. However, I don't know if this applies to Dovecot because AFAIK MMAP doesn't work well with O_DIRECT... ***Hay Timo, does/can Dovecot use Linux O_DIRECT for writing the mail files?
mmap doesn't matter, because mbox files aren't read with mmap. But I doubt it's a good idea to use O_DIRECT for mbox files, because even if it gives higher iops, you're using more iops because you keep re-reading the same data from disk since it's not cached to memory.
As for O_DIRECT writes.. I don't know if it's such a good idea either. If client is connected, it's often going to read the mail soon after it was written, so it's again a good idea that it stays in cache.
I once wrote a patch to free message contents from OS cache once the message was read entirely, because it probably wouldn't be read again. No one ever reported if it gave any better or worse performance. http://dovecot.org/patches/1.1/fadvise.diff