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

Russell Bryant russell at digium.com
Wed Sep 8 17:33:01 CDT 2010



----- Original Message -----
> 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 :-)

Thanks for the feedback, guys!  I'll get this merged sometime tomorrow most likely.  Also thanks to Stefan Schmidt for the great performance testing and analysis he has been doing lately!  Some great changes are going to come out of this effort.

--
Russell Bryant
Digium, Inc.  |  Engineering Manager, Open Source Software
445 Jan Davis Drive NW   -    Huntsville, AL 35806  -  USA
jabber: rbryant at digium.com    -=-    skype: russell-bryant
www.digium.com -=- www.asterisk.org -=- blogs.asterisk.org



More information about the asterisk-dev mailing list