[ZODB-Dev] Use of fsync in ZODB

Neil Schemenauer nas at mems-exchange.org
Fri Jul 23 17:56:43 EDT 2004


On Fri, Jul 23, 2004 at 05:31:47PM -0400, Tim Peters wrote:
> We could plop in any number of additional flush+fsync calls if
> someone is having a real problem here, but calling them isn't free
> (moving disk heads is enormously expensive relative to current CPU
> speeds), and if an OS has an unreliable fsync() I'm not sure it
> can be made more reliable just by calling it a lot <wink>.

Right.  The FileStorage module for Durus doesn't call fsync at all.
It's a false sense of security, IMHO.  It also makes things slow.
Modern discs do write caching, some of them do it no matter what the
OS tells them.  Also, if your hardware is unreliable you can have
lots of ways of losing data that fsync will not save you from.  If
you need reliability it's probably better to go with replicated
storage.

For an amusng example of the other extreme, try running strace on
the Subversion server.  I've seen it calling fsync thousands of
times for each transaction.  Luckily there is a config option to
disable that nonsense.

  Neil


More information about the ZODB-Dev mailing list