On Tue, Oct 21, 2008 at 05:50:09AM -0700, Marcelo Leal wrote:
>  If i have many small files (smaller than 128K), i would not waste
>  time reading 128K? And after the ZFS has allocated a FSB of 64K for
>  example, if that file gets bigger, ZFS will use 64K blocks right?

ZFS uses the smallest suitable block size and will always use a single
block for files whose size is less than the dataset record size.

I.e., if you have a file with 500 bytes of data then ZFS will use a 512
byte block size.  If you then append 400 bytes then ZFS will switch to
using a single 1024 byte block.  And so on up to the record size, which
defaults to 128KB.  So if you have a file that's 1MB then ZFS will use 8
128KB blocks to store that file's data.

Bottom-line: small files use small blocks -- you don't need to worry
about reading 128KB blocks for small files.

For the whole maildir vs. mailbox thread, I'd say that any solution that
involves an index in the MUA will give you better performance.  In the
maildir case you'll always be reading files in toto, so the record size
will be irrelevant.  In the mailbox+index case you'll be doing random
access reads which won't even be aligned, but which will typically be of
mean-e-mail-size bytes, so setting the record size to be just larger
than the mean e-mail size should help.

And, of course, there's the index, if your MUA keeps one.  We just had a
thread on Evolution and its SQLite3 DB -- setting the SQLite3 page size
and the ZFS record size to match helps a lot.  If you have large indexes
then you may want to do the same.

The natural record size for one part of the application may not match
the natural record size for another.  We really need a way to set the
recordsize on a per-file basis.

Nico
-- 
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to