Places:FsyncApproach: Difference between revisions

Line 50: Line 50:


Cons:
Cons:
=Grow File in Large Hunks Approach=
Summary from Andrew Morton:
<blockquote>
If the file does need to grow during regular operation then I'd suggest
that it be grown in "large" hunks - say, extend it (with write()) by a
megabyte at a time.  Then fsync it to get the metadata written.  Then
proceed to use sync_file_range() for the now-non-extending small writes.
So the large-write-plus-fsync is "rare".
</blockquote>
Pros:
* Can reasonably easily be implemented in vfs sqlite3_io_methods.
Cons:
* Only a solution for Linux.
* Still waits on ([https://bugzilla.mozilla.org/show_bug.cgi?id=421482#c152 less significant disk access]) regularly, and so may need to be combined with async IO or another approach for optimal behavior.
Confirmed users
85

edits