Hello Darren,

Tuesday, May 23, 2006, 4:19:05 PM, you wrote:

DJM> Robert Milkowski wrote:
>> The problem is that with stronger compression algorithms due to
>> performance reasons I want to decide which algorithms and to what
>> files ZFS should try to compress. For some files I write a lot of data
>> even if they are compressing quite good i don't want it - too much CPU
>> would be consumed. However for other files in the same data pool I
>> know we do not write them that often so compression for them would be
>> useful (and cheap in terms of CPU).

DJM> This is exactly the reason I don't want the applications running as a 
DJM> normal user to be able to turn on more expensive compression algorithms
DJM> if the administrator of the data set has explicitly not turned on 
DJM> compression.

DJM> I think there are three possible modes here:

DJM> 1) No compression ever.
DJM> 2) Current behaviour
DJM> 3) New: Best effort from ZFS (ie current behaviour) with hints from 
DJM> application on the data eg, don't bother trying this is an MP3.

Definitely that's something I had in mind.
To be more precise case #3 should be something like either ZFS tries
to determine itself which compression to use for each file (block?) or
administrator can setup default compression for a dataset. However in
both these cases application is able either hint ZFS or even force
specific compression algorithm for a file (block? given write? what
about mmap()?).

In some cases algorithm per block (write()) would be preferred - like
if our application writes an email and it already knows what kind of
attachments there are so it doesn't make sense to even try to compress
this block (however rest of the mail could be compressed). Something
like this:

    ioctl(fd, strong compression)
    write(fd, buf, s1) - headers and body
    ioctl(fd, no compression)
    write(fd, buf, s1) - jpeg attachement

However writev() or sendfilev() would be preferred - I'm not sure how
to cope with that situation.

To make API more universal applications should have an option not only
to request specific compression but to request some kind of
compression level without actually specifying algorithm - like I want
light compression or I don't care about CPU and want heavy compression
(or something in a middle).

ps. and of course if admin chooses option #1 application can't force
ZFS to use compression. And in #2 only compression selected by sys
admin is used.

-- 
Best regards,
 Robert                            mailto:[EMAIL PROTECTED]
                                       http://milek.blogspot.com

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

Reply via email to