couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: svn commit: r815404 - /couchdb/branches/0.10.x/etc/couchdb/default.ini.tpl.in
Date Wed, 16 Sep 2009 08:22:07 GMT

On 16 Sep 2009, at 10:05, Brian Candler wrote:

> On Tue, Sep 15, 2009 at 11:30:37AM -0700, Chris Anderson wrote:
>> The basic tradeoff here is between safety and speed. With a simple
>> benchmark on my Mac laptop (OSX 10.5) delayed_commits gives ~230
>> writes/second while we only get about 5/sec with the slow safe  
>> option.
>>
>> I think 5 writes/second is too slow to be useful, so it doesn't  
>> matter
>> how safe it is.
>
> And aside from that: why is it only 5 writes per second? I understand
> write -> sync -> write metadata -> sync, but any half-decent drive  
> should
> still be able to do 100+ random writes per second.
>
> Would OSX be putting a sleep() in there somewhere??

Mac OS X docs encourage to use fcntl(F_FULLFSYNC) instead of
a simple fsync()*. The fcntl() call forces the drive to flush buffers
while fsync() just flushes the kernel buffer.

The guarantee that data ends up on the disk as promised is higher
using fcntl() on Mac OS X compared to fsync() on Linux.

Cheers
Jan
--
* http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man2/fsync.2.html


Mime
View raw message