Tuning for PostGreSQL Database

Terry Lambert tlambert2 at mindspring.com
Tue Jul 22 23:15:14 PDT 2003

Simon J Mudd wrote:
> Someone else mentioned Qmail. I use Postfix and I know the author
> relies on fsync semantics before confirming the acceptance of email.
> I'm sure Qmail (and sendmail, ...) does the same.  They should do -
> the RFC requires this (that mail can't be lost once it is accepted for
> delivery).

It's OK t fsync() the data file before sending back the "250 OK";
RFC 821 (and now 2821) require this behavior: the data much be
committed to stable storage before the "250 OK" response is sent
(unless you are HotMail, of course ;^)).

The problem with qmail is that it assumes that it needs to sync
the directory because it thinks the underlying FS implemention
violates the POSIX standard with regard to "SHALL be updated"
instead of "SHALL be marked for update" semantics on directory
metadata.  So qmail does an extra fsync() on something that
doesn't need to be fsync()'ed.

This makes qmail unnecessarily slow, in order to make it safe
for people to run nominally POSIX code on non-POSIX compliant

For POSIX systems, qmail should turn this behaviour off.

Unfortunately, there are a number of systems which define POSIX
manifest constants, thus lying about whether or not they are
really POSIX compliant systems.

-- Terry

More information about the freebsd-performance mailing list