Yang Zhang put forth on 9/20/2010 3:46 PM:
> On Mon, Sep 20, 2010 at 12:33 PM, Wietse Venema <wie...@porcupine.org> wrote:
>> Yang Zhang:
>>> Can you pinpoint the exact RFC & section you're referring to? Thanks.
>>
>> I will give you as home work to study the following documents:
>>
>> RFC 821
>> RFC 2821
>> RFC 5321
>>
>> These have lots of other good stuff about Internet mail.
> 
> I had looked at these and couldn't find any specification of the
> guarantees - would you mind pointing out what you're referring to?
> Thanks, greatly appreciate it.

Take a look at this previous thread on this mailing list.  An OP was
having a performance problem with ~250 msgs/sec and only 1 spindle worth
of throughput for the incoming and active queues (software mirror of two
disks).  He proposed his own solution to the problem (the wrong solution
for obvious reasons) as modifying the Postfix source and _eliminating_
fsync:

http://www.pubbs.net/200911/postfix/9555-how-to-increase-throughput-of-postfix-to-local-user.html

--- postfix-2.5.9/src/global/mail_stream.c.orig 2009-11-05
23:27:23.000000000 +0300
+++ postfix-2.5.9/src/global/mail_stream.c 2009-11-05 23:27:34.000000000
+0300
@@ -292,9 +292,9 @@
|| (want_stamp && stamp_path(VSTREAM_PATH(info->stream), want_stamp))
#endif
|| fchmod(vstream_fileno(info->stream), 0700 | info->mode)
-#ifdef HAS_FSYNC
+/* #ifdef HAS_FSYNC
|| fsync(vstream_fileno(info->stream))
-#endif
+#endif */
|| (check_incoming_fs_clock
&& fstat(vstream_fileno(info->stream), &st) < 0)
)

As you can clearly see in the code, Postfix executes fsync, which this
OP commented out.  Again, the OP didn't use this solution, merely asked
if it would work.  IIRC he temporarily fixed the issue by inserting a
wait to slow down the incoming queue and later added more spindles to
the system as a permanent fix.

So, the short answer is yes, Postfix uses fsync for durability, and the
code that does so, or a portion of it, it pasted above.

-- 
Stan

Reply via email to