lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: 答复: about lucene in action 2
Date Sun, 14 Mar 2010 13:40:33 GMT
sync (fsync to the OS) tells the OS to make sure everything associated
with that file is moved to stable storage in the IO system.  (It
doesn't read anything back).

On flush we write the files to disk, which is usually very fast since
it writes into the OS's RAM write cache, but we do not sync.

sync (fsync) is in general a costly operation as it forces the OS & IO
subsystem to flush their write caches, journals, etc.

So, only on commit do we sync.

You should measure the cost in practice to see what it works out to be
for your context... it's very OS/filesytem dependent, and also depends
on how many segments your index has when you commit, whether you're
using CFS, etc.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message