[ZODB-Dev] Re: Use of fsync in FileStorage

Tim Peters tim at zope.com
Fri Jul 30 00:09:39 EDT 2004


[Casey Duncan]
> Some timing on a 700MHz notebook with a 30gig drive running FreeBSD
> 5.1/ufs:
>
> Stock ZODB:    57.9809 seconds, 172.471 txn/sec
> Without fsync: 36.0513 seconds, 277.383 txn/sec
>
> (I didn't bother with two fsyncs)

I hope you change your mind and try that.  So far it looks like an
additional fsync causes major degradation (vs the status quo) only on my
box, but I'd like to get as much evidence for that as reasonably possible.

> The former was I/O bound and the latter CPU bound.
>
> I definitely think this means we should consider a knob for those willing
> to run fast and loose versus those wanting to trade performance for
> better data integrity.

The rub is that you might not notice any difference -- the test driver here
doesn't emulate running a real app, it just beats on a FileStorage as
intensely as possible, doing nothing else.  FileStorage probably isn't "the
bottleneck" in any Zope application today, so I expect it to have a minor
effect -- possibly even an unmeasurable one.

Example:  the difference between 0 and 1 fsyncs is a factor of *100* in txn
rate on my box in this test.  If I disable fsyncs, the ZODB/ZEO --all tests
finish 3 minutes faster on this box.  That's worth something to me, but they
still take 20 minutes to run, and dropping fsync on this box gives by far
the biggest win (and adding another fsync the biggest loss) across all boxes
reported on so far.

The test suite doesn't emulate a real app either, of course.  It does seem
worth trying 0, and 2, in a real app.

> For development, testing, loading and database intensive tasks like
> cataloging the "fast and loose mode" could be pretty desireable, with the
> caveat that there may be little real difference between the two with a
> decent disk controller.

Or at all.  Note that because Jeremy put the existing fsync in tpc_finish,
dropping that fsync won't do anything primary to speed tpc_vote (it may have
good secondary effects), and tpc_vote time is "a classic" ZEO bottleneck
under heavy load.

No way to tell for sure without trying it (for more values of "it" than I
can count ...).



More information about the ZODB-Dev mailing list