ZFS, Zvol, iSCSI and windows
Tom Curry
thomasrcurry at gmail.com
Fri Sep 25 14:05:50 UTC 2015
On Fri, Sep 25, 2015 at 7:13 AM, Karli Sjöberg <karli.sjoberg at slu.se> wrote:
> fre 2015-09-25 klockan 11:08 +0200 skrev Willem Jan Withagen:
> > Hi,
> >
> > Because of the Network Video Recorder (on windows) we use only likes
> > "real" disks, and not SMB disks. We started using ZVOLs which are
> > exported thru iSCSI/ctld....
> >
> > And that works really well, so there all thumbs up for this combo.
> >
> > However..... (you knew that was coming)
> > I do have some questions, and hope somebody can share some insights.
> >
> > 1)
> > This is a ZFS question.
> >
> > I have created a ZVOL with:
> > zfs create -s -V 5T zfsraid/nvr2
> >
> > Looking at the disk usage in 'zfs get all':
> > NAME PROPERTY VALUE SOURCE
> > zfsraid/nvr2 used 9.97T -
> > zfsraid/nvr2 available 438G -
> > zfsraid/nvr2 referenced 9.97T -
> > zfsraid/nvr2 compressratio 1.00x -
> > zfsraid/nvr2 reservation none default
> > zfsraid/nvr2 volsize 5T local
> > zfsraid/nvr2 volblocksize 8K -
> > zfsraid/nvr2 checksum on default
> > zfsraid/nvr2 compression lz4 default
> > zfsraid/nvr2 primarycache all default
> > zfsraid/nvr2 secondarycache all default
> > zfsraid/nvr2 usedbysnapshots 0 -
> > zfsraid/nvr2 usedbydataset 9.97T -
> > zfsraid/nvr2 usedbychildren 0 -
> > zfsraid/nvr2 usedbyrefreservation 0 -
> > zfsraid/nvr2 sync standard default
> > zfsraid/nvr2 written 9.97T -
> > zfsraid/nvr2 logicalused 4.97T -
> > zfsraid/nvr2 logicalreferenced 4.97T -
> > zfsraid/nvr2 volmode default default
> >
> > And what sort of "worries" me is that it seems that this volume is using
> > twice the amount of diskspace it is offering as ZVOL?
> >
> > a) Is this really true?
> > b) Should I have done something different to not waste so much overhead?
> >
> > Note that the compression rate is 1.00x, which is of course due to
> > writing h264 media streams that do not compress at all. But is the
> > parents default, and I haven't turned it off.
> >
> > 2)
> > The second one might be more a Windows question, but anyways.
> >
> > The export is that same 5T ZVOL, plain create with
> > zfs create -s -V 5T zfsraid/nvr2
> > Under Windows I used the regular stuff to format the dis with GPT and
> > NTFS with 8k segments. (matching the ZVOL blocksize)
> >
> > Upon reboot FreeBSD notices the following:
> > GEOM_PART: partition 1 on (zvol/zfsraid/nvr2, GPT) is not aligned on
> > 8192 bytes
> > By itself not technical problem. But the warning does hint that the
> > alignment is thus, that performance might suffer. the backing disks are
> > WD REDs which are 4K sectors.... So the misalignment could cause too
> > many read/writes for writing.
> >
> > Does anybody have a clue as how to get Windows to do the aligning
> correctly?
> >
> > _______________________________________________
> > freebsd-fs at freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-fs
> > To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
>
>
> Is it this effect you are seeing:
>
> https://forums.freebsd.org/threads/mitigating-4k-disk-issues-on-raidz.37365/
>
> /K
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
>
I ran into the same problem, the solution was to create the zvol with a
larger volblocksize like 32k. If space efficiency is the primary concern I
believe you need to choose a blocksize that is greater than or equal to the
number of non parity drives multiplied by their sector size. Judging by
your overhead I'm going to assume you have a 6 disk raidz2, so 4 * 4k = 16k
at least. Try creating another zvol with "-o volblocksize=16k" and see how
that treats you.
As to your second question, modern versions of windows should align
partitions correctly, what version are you using? You may wish to open an
elevated command prompt and sanity check the output of "fsutil fsinfo
ntfsinfo x:"
Finally, from my own experience with using iscsi under windows I found I
had a random 4k iops increase from ~10,000 to ~90,000 (which is close to my
pools real speed) by adjusting the following registry key
Create this DWORD key with a value of 1:
HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E97B-E325-11CE-BFC1-08002BE10318}\<Instance
Number>\Parameters\iSCSIDisableNagle
More information about the freebsd-fs
mailing list