[zfs-discuss] Checksum question.

Bob Friesenhahn
Wed, 02 Jul 2008 06:11:07 -0000

On Tue, 1 Jul 2008, Brian McBride wrote:
>
> Customer:
> I would like to know more about zfs''s checksum feature.
I''m guessing
> it is something that is applied to the data and not the disks (as in
> raid-5).

Data and metadata.

> For performance reasons, I turned off checksum on our zfs filesystem
> (along with atime updates).  Because of a concern for possible data
> corruption (silent data corruption), I''m interested in turning
checksum
> back on.  When I do so, will it create checksums for existing files or
> will they need to be rewritten?  And can you tell me the overhead
> involved with having checksum active (CPU time, additional space)?

Turning the checksums off only disables them for user data.  They are
still enabled for filesystem metadata.  I doubt that checksums will be
computed for existing files until a block is copied/modified, but
perhaps scrub can do that (I don''t know).  On modern AMD Opteron
hardware it seems that CPU overhead for checksums is very low (e.g. <
5%).

I don''t see much value from disabling both atime and checksums in the
fileysystem.  There is more value to disabling atime updates in NFS
mounts.  Zfs is pretty lazy about updates so atime just adds slightly
to total I/O but without noticeably increasing latency.

In a benchmark I did using iozone with 8k I/O blocks in ZFS
filesystems with 128K block size, I see that with atime the random
witers test results in 834.79 ops/sec but without it increases to
853.56 ops/sec.  This is a very small performance improvement.
Likewise, with checksums disabled (but atime enabled) I see 839.78
ops/sec.  Using 8K I/O blocks in a filesystem with 8K block size
resulted in a huge performance difference but unfortunately I failed
to record the result.

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