[Discuss] Adventures in N40L Land

Richard Pieri richard.pieri at gmail.com
Fri Feb 24 19:41:06 EST 2012


I mentioned poor zfs-fuse performance.  Turned out I was on the right track with the partition alignment so I tried properly aligned GPT partitions.  That didn't work -and- it triggered a spam of kernel warnings due to improper IOCTLs on disk partitions.

It turns out that ZFS itself doesn't know how to align on 4K disks at all, partitioned or otherwise.  There are proposed solutions which all boil down to setting the ashift option.  A proper solution hasn't worked its way into zfs-fuse, yet.  Instead, I dug up a one-line change to zpool_vdev.c that forces ashift=12 (4K alignment) and recreated my RAID-Z pool.  The result: sustained write performance has gone from 10MB/s to 30MB/s.  Not a bad gain for a simple fix (and a few hours of digging for it :).

The fix.  Find this line in zpool_vdev.c

  verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_IS_LOG, is_log) == 0);

Add this line immediately after it:

  verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_ASHIFT, 12) == 0);

and compile.

--Rich P.




More information about the Discuss mailing list