On Fri, Oct 13, 2006 at 08:30:27AM -0700, Matthew Ahrens wrote:
> Jeremy Teo wrote:
> >Would it be worthwhile to implement heuristics to auto-tune
> >'recordsize', or would that not be worth the effort?
> 
> It would be really great to automatically select the proper recordsize 
> for each file!  How do you suggest doing so?

I would suggest the following:

 - on file creation start with record size = 8KB (or some such smallish
   size), but don't record this on-disk yet

 - keep the record size at 8KB until the file exceeds some size, say,
   .5MB, at which point the most common read size, if there were enough
   reads, or the most common write size otherwise, should be used to
   derive the actual file record size (rounding up if need be)

    - if the selected record size != 8KB then re-write the file with the
      new record size

    - record the file's selected record size in an extended attribute

 - on truncation keep the existing file record size

 - on open of non-empty files without associated file record size stick
   to the original approach (growing the file block size up to the FS
   record size, defaulting to 128KB)

I think we should create a namespace for Solaris-specific extended
attributes.

The file record size attribute should be writable, but changes in record
size should only be allowed when the file is empty or when the file data
is in one block.  E.g., writing "8KB" to a file's RS EA when the file's
larger than 8KB or consists of more than one block should appear to
succeed, but a subsequent read of the RS EA should show the previous
record size.

This approach might lead to the creation of new tunables for controlling
the heuristic (e.g., which heuristic, initial RS, file size at which RS
will be determined, default RS when none can be determined).

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

Reply via email to