[zfs-discuss] zfs compression ratio

Ruben Kelevra ruben at vfn-nrw.de
Sun Jan 31 07:48:59 EST 2016


Take a look at zdb -DD poolname

The compression might be different due different recordsizes, because larger recordsizes can be compressed more efficiently.


Best regards 

Ruben 

> Am 30.01.2016 um 17:39 schrieb Miguel Wang via zfs-discuss <zfs-discuss at list.zfsonlinux.org>:
> 
> Hello all:
> 
> On one of the servers (p-05), I have a backup of 3.76T used
> with compressratio of 2.58 (lz4):
> 
> NAME                         USED  AVAIL  REFER  MOUNTPOINT
> bak0                        3.76T  26.3T    19K  /bak0
> 
> bak0/mysqlbak/backup        compressratio         2.58x                     -
> bak0/mysqlbak/backup        refcompressratio      2.58x                     -
> 
> After I copied (innobackupex or extrabackup with -copy-back option, which I believe
> is just cp equivalent) to another file system, it becomes 5.32T with compressratio of 1.81 (lz4):
> 
> NAME                         USED  AVAIL  REFER  MOUNTPOINT
> local0/mysqldata/data       5.32T   281G  5.32T  /srv/mysqldata/data
> 
> local0/mysqldata/data       compressratio         1.81x                     -
> local0/mysqldata/data       refcompressratio      1.81x                     -
> 
> I did the math, and it seems it is correct: 3.76T*2.58/1.81 = 5.35T.
> 
> However, when I export and import the backup pool bak0 to another system (p-11),
> and used paralleled rsync to copy the files, I get:
> 
> root at mdb-01-p-11:/srv/mysqldata/data# zfs list
> NAME                         USED  AVAIL  REFER  MOUNTPOINT
> bak0/mysqlbak/backup        3.76T  26.3T  3.76T  /srv/mysqlbak/backup
> local0/mysqldata/data       5.61T      0  5.61T  /srv/mysqldata/data
> 
> root at mdb-01-p-11:/srv/mysqldata/data# zfs get all | grep compressratio | grep -E 'bak0/mysqlbak/backup|local0/mysqldata/data'
> bak0/mysqlbak/backup        compressratio         2.58x                     -
> bak0/mysqlbak/backup        refcompressratio      2.58x                     -
> local0/mysqldata/data       compressratio         1.81x                     -
> local0/mysqldata/data       refcompressratio      1.81x                     -
> 
> The backup size and compressratio did not change [the same pool], and the
> destination compressratio is also 1.81x, but the size becomes 5.61T and
> completely full. The math does not work anymore.
> 
> Here are my questions:
> 
> [1] What determines the compressratio? How fast is the copy is done? cp vs rsync?
> single thread vs multiple processes?
> 
> [2] Does the compressratio relate to the read and write performance on the files?
> 
> Thanks a lot!
> 
> PS: I am on Ubuntu 14.04.1, and current release of zfs [0.6.5.4-1].
> 
> # dpkg -l | grep zfs
> ii  libzfs2                              0.6.5.4-1~trusty                    amd64        Native OpenZFS filesystem library for Linux
> ii  mountall                             2.53-zfs1                           amd64        filesystem mounting tool
> ii  ubuntu-zfs                           8~trusty                            amd64        Native ZFS filesystem metapackage for Ubuntu.
> ii  zfs-dkms                             0.6.5.4-1~trusty                    amd64        Native OpenZFS filesystem kernel modules for Linux
> ii  zfs-doc                              0.6.5.4-1~trusty                    amd64        Native OpenZFS filesystem documentation and examples.
> ii  zfsutils                             0.6.5.4-1~trusty                    amd64        Native OpenZFS management utilities for Linux
> 
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss at list.zfsonlinux.org
> http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss


More information about the zfs-discuss mailing list