softupdates and two different MTAs

Claus Assmann freebsd+fs at esmtp.org
Tue Mar 16 22:04:59 PST 2004


I'm comparing the performance of sendmail 8 with sendmail 9 (called
sm8 and sm9 in the following) and experienced some interesting
results about disk I/O on FreeBSD; maybe someone has some explanations
for these numbers?

A modified iostat(8) program is used to show the number of read and
write disk I/O operations.

The following test was performed: a program on one machine sends
1000 mails using up to 100 concurrent connections to the MTA on a
second machine running FreeBSD 4.9 (with SCSI drives) which relays
the mails to a third host.

+---------------------------------------------------------------+
| program                  | FS               |  writes | reads |
|--------------------------+------------------+---------+-------|
| sm8.12.11                | UFS, softupdates |     236 |     0 |
|--------------------------+------------------+---------+-------|
| sm8.12.11                | UFS, no          |    8100 |     1 |
|                          | softupdates      |         |       |
|--------------------------+------------------+---------+-------|
| sm9.0.0.12               | UFS, softupdates |    3500 |     4 |
|--------------------------+------------------+---------+-------|
| sm9.0.0.12               | UFS, no          |    6300 |     0 |
|                          | softupdates      |         |       |
+---------------------------------------------------------------+

Some background: sm8 forks a process for each incoming mail which
in turn also delivers the mail (DeliveryMode=background); sm9
consists of 4 communicating processes all of which are multi-threaded.
Both MTAs call fsync(2) before accepting a mail.

Question: why does sm8 use so few writes? Can softupdates eliminate
or cluster most writes including fsync(2)? Why doesn't this work
for sm9?

I had the following idea why there are so many writes for sm9
compared to sm8: sm9 has only one SMTP server process and since
fsync(2) is synchronous the process has to wait for it to return.
In sm8 there are many processes which can proceed independently and
softupdates could reorder the operations and perform a "group commit",
i.e., schedule multiple fsync(2) operations together and then a
group of processes can proceed.

However, a simple test using 2 or 4 server processes doesn't show
a significant decrease in the number of write operations.

Does someone have an explanation for this behavior? TIA!


More information about the freebsd-fs mailing list