NFS reads vs. writes

Bob Friesenhahn bfriesen at simple.dallas.tx.us
Mon Jan 4 21:10:43 UTC 2016


On Mon, 4 Jan 2016, Mikhail T. wrote:

> Yes, indeed. Disabling sync got the writing throughput all the way up to
> about 86Mb/s... I still don't fully understand, why local writes are
> able to achieve this speed without async and without being considered
> dangerous.

Local writes are buffered to RAM and the current set of changes (many 
writes may have been obviated by overwrites) are written at all once 
as part of the next ZFS transaction group, which can take up to 5 
seconds to occur.

Each transaction group completes after all disks have positively 
acknowledged a cache flush.

Using this approach, the on-disk data is coherent but it is possible 
to lose up to 5 seconds of data (back to the previous commited 
transaction group).

The zfs intent log (slog) remembers the pending synchronous writes 
(which are still written into RAM!) and marks them as committed when 
the transaction group completes.  If the server loses power or 
spontaneously reboots, the pending writes from the intent log are 
written to pool disks when the server comes up.

Bob
-- 
Bob Friesenhahn
bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


More information about the freebsd-fs mailing list