Andrew Deason wrote:
On Thu, 17 Sep 2009 18:40:49 -0400
Robert Milkowski <mi...@task.gda.pl> wrote:

if you would create a dedicated dataset for your cache and set quota
on it then instead of tracking a disk space usage for each file you
could easily check how much disk space is being used in the dataset.
Would it suffice for you?

No. We need to be able to tell how close to full we are, for determining
when to start/stop removing things from the cache before we can add new
items to the cache again.

but having a dedicated dataset will let you answer such a question immediatelly as then you get from zfs information from for the dataset on how much space is used (everything: data + metadata) and how much is left.

I'd also _like_ not to require a dedicated dataset for it, but it's not
like it's difficult for users to create one.

no, it is not.

Setting recordsize to 1k if you have lots of files (I assume) larger than that doesn't really make sense. The problem with metadata is that by default it is also compressed so there is no easy way to tell how much disk space it occupies for a specified file using standard API.

We do not know in advance what file sizes we'll be seeing in general. We
could of course tell people to tune the cache dataset according to their
usage pattern, but I don't think users are generally going to know what
their cache usage pattern looks like.

I can say that at least right now, usually each file will be at most 1M
long (1M is the max unless the user specifically changes it). But
between the range 1k-1M, I don't know what the distribution looks like.

What I meant was that I believe that default recordsize of 128k should be fine for you (files smaller than 128k will use smaller recordsize, larger ones will use a recordsize of 128k). The only problem will be with files truncated to 0 and growing again as they will be stuck with an old recordsize. But in most cases it won't probably be a practical problem anyway.



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

Reply via email to