> From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss-
> boun...@opensolaris.org] On Behalf Of Jim Klimov
> 
> I wonder if it is possible (currently or in the future as an RFE)
> to tell ZFS to automatically read-ahead some files and cache them
> in RAM and/or L2ARC?
> 
> One use-case would be for Home-NAS setups where multimedia (video
> files or catalogs of images/music) are viewed form a ZFS box. For
> example, if a user wants to watch a film, or listen to a playlist
> of MP3's, or push photos to a wall display (photo frame, etc.),
> the storage box "should" read-ahead all required data from HDDs
> and save it in ARC/L2ARC. Then the HDDs can spin down for hours
> while the pre-fetched gigabytes of data are used by consumers
> from the cache. End-users get peace, quiet and less electricity
> used while they enjoy their multimedia entertainment ;)

This whole subject is important and useful - and not unique to ZFS.  The
whole question is, how can the system predict which things are going to be
requested next?

In the case of a video - there's a big file which is likely to be read
sequentially.  I don't know how far readahead currently will read ahead, but
it is surely only smart enough to stay within a single file.  If the
readahead buffer starts to get low, and the disks have been spun down, I
don't know how low the buffer gets before it will trigger more readahead.
But at least in the case of streaming video files, there's a very realistic
possibility that something like the existing readahead can do what you want.

In the case of your MP3 collection...  Probably the only thing you can do is
to write a script which will simply go read all the files you predict will
be read soon.  The key here is the prediction - There's no way ZFS or
solaris, or any other OS in the present day is going to intelligently
predict which files you'll be requesting soon.  But you, the user, who knows
your usage patterns, might be able to make these predictions and request to
cache them.  The request is simply - telling the system to start reading
those files now.  So it's very easy to cache, as long as you know what to
cache.

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

Reply via email to