RAID-Z wasted space - asize roundups to nparity +1

Freddie Cash fjwcash at gmail.com
Tue Jan 29 17:05:34 UTC 2013


On Jan 29, 2013 2:52 AM, "Adam Nowacki" <nowakpl at platinum.linux.pl> wrote:
>
> On 2013-01-28 22:55, Matthew Ahrens wrote:
>>
>> This is so that we won't end up with small, unallocatable segments.
>>   E.g. if you are using RAIDZ2, the smallest usable segment would be 3
>> sectors (1 sector data + 2 sectors parity).  If we left a 1 or 2 sector
>> free segment, it would be unusable and you'd be able to get into strange
>> accounting situations where you have free space but can't write because
>> you're "out of space".
>
>
> Sounds reasonable.
>
>
>> The amount of waste due to this can be minimized by using larger
>> blocksizes (e.g. the default recordsize of 128k and files larger than
>> 128k), and by using smaller sector sizes (e.g. 512b sector disks rather
>> than 4k sector disks).  In your case these techniques would limit the
>> waste to 0.6%.
>
>
> This brings another issue - recordsize capped at 128KiB. We are using the
pool for off-line storage of large files (from 50MB to 20GB). Files are
stored and read sequentially as a whole. With 12 disks in RAID-Z2, 4KiB
sectors, 128KiB record size and the padding above 9.4% of disk space goes
completely unused - one whole disk.
>
> Increasing recordsize cap seems trivial enough. On-disk structures and
kernel code support it already - a single of code had to be changed
(#define SPA_MAXBLOCKSHIFT - from 17 to 20) to support 1MiB recordsizes.
This of course breaks compatibility with any other system without this
modification. With Suns cooperation this could be handled in safe and
compatible manner via pool version upgrade. Recordsize of 128KiB would
remain the default but anyone could increase it with zfs set.

There's work upstream (Illumos, I believe, maybe Delphix?) to add support
for recordings above 128 KB. It'll be added ad a feature flag, so only
compatible with open-source ZFS.


More information about the freebsd-fs mailing list