[asterisk-dev] [Code Review] Rate limit astdb->sync() calls

Kevin P. Fleming kpfleming at digium.com
Wed Sep 8 10:49:12 CDT 2010


On 09/08/2010 10:39 AM, Simon Perreault wrote:
> On 2010-09-08 11:30, Russell Bryant wrote:
>> So what do others think?  Rate limiting fsync() calls to twice a
>> second gives a half second window of operations that will be lost in
>> the case of a system crash.  Is that acceptable for the sake of a
>> significant performance gain?  I think it is.  I just want to make
>> sure others agree.
> 
> +1

On modern systems, calling fsync() is *not*, in fact, a guarantee that
the data has been written to the persistent media (see the many threads
on LKML that periodically cover this topic). The only guarantee that it
provides is that the kernel has sent the relevant blocks to the storage
device(s) involved... whether they have actually been written or not is
up to the device.

As far as I'm concerned, if we *never* called fsync on the astdb, and
just let the kernel and filesystem push the data out as they saw fit,
that would probably suffice for most people. Given that, doing it twice
per second seems just fine :-)

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list