Re: new database files not compressed

Hamish Moffatt
2020-08-31T23:50:47Z

On 31/8/20 10:57 pm, Nikolay Borisov wrote:
>
> This means the data being passed to btrfs is not compressible. I.e after
> coompression the data is not smaller than the original, input data.

It is though - if I copy it, or run defrag, it compresses very well:

$ mount | grep btrfs
/dev/sdb on /mnt/test type btrfs
(rw,relatime,compress-force=zstd:3,space_cache,subvolid=5,subvol=/)
$ zcat ~/*.zip | gbak -REP -page 16384 stdin test2.fdb
$ sudo compsize test2.fdb
Type       Perc     Disk Usage   Uncompressed Referenced
TOTAL      100%      194M         194M         191M
none       100%      194M         194M         191M

$ dd if=test2.fdb of=test2.fdb2 bs=16k
12250+0 records in
12250+0 records out
200704000 bytes (201 MB, 191 MiB) copied, 0.151375 s, 1.3 GB/s
$ sync
$ sudo compsize test2.fdb2
Type       Perc     Disk Usage   Uncompressed Referenced
TOTAL        8%       17M         191M         191M
zstd         8%       17M         191M         191M

$ sudo btrfs fi defrag -czstd test2.fdb
$ sudo compsize test2.fdb
Type       Perc     Disk Usage   Uncompressed Referenced
TOTAL        8%       17M         191M         191M
zstd         8%       17M         191M         191M

So it must be something about how Firebird is creating or writing the
file, as Zygo wrote. I set the page size to 16k (default 4k) and
although I see Firebird making 16k writes, it is not affecting the result.

Hamish