[Python-Dev] Re: RELEASED Python 2.3.1
"Martin v. Löwis"
martin at v.loewis.de
Sun Sep 28 15:52:44 EDT 2003
Barry Warsaw wrote:
> Before I enable it unconditionally, I'd want to be more certain that
> it's necessary, or useful for the majority of sites, and that the
> performance hit is either worth it, not as bad as my benchmarks showed,
> or at least not as observably bad under real-world conditions.
You should first understand why message loss occurs if there is no
fsync. For example, if the MTA stores incoming messages on disk, then
invokes mailman, message loss may occur if the MTA deletes the message
from the spool before mailman has fsync'ed its copy, and the power goes
out at this moment.
If so, users might be better of using a powerful filesystem. I *think*
that, e.g. on Linux, ext3fs with ordered data writes might be
sufficient, as deletion of the file should only occur after the data
have been written (OTOH, it might be that ext3 in journalled mode is
needed, if data and metadata changes are not mutually subject to the
ordering). This should be less expensive than fsync, as the journalled
file system will still perform lazy writes - just in the right order.
Also notice that some file system drivers are incapable of implementing
fsync correctly, so they fall back to treat fsync(2) like sync(2), which
is quite expensive.
Regards,
Martin
More information about the Python-Dev
mailing list