public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Hamish Moffatt <hamish-btrfs@moffatt.email>,
	Roman Mamedov <rm@romanrm.net>
Cc: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>,
	linux-btrfs@vger.kernel.org
Subject: Re: new database files not compressed
Date: Tue, 1 Sep 2020 08:15:23 +0300	[thread overview]
Message-ID: <0bf29a8c-23b2-26f4-2efd-2e82f38c437d@suse.com> (raw)
In-Reply-To: <2d060b13-7a1a-7cc5-927f-2c6a067f9c03@moffatt.email>



On 1.09.20 г. 2:50 ч., Hamish Moffatt wrote:
> 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:
> 
> 

As Zygo explained - with 16k writes you'd need at least 25% compression
 in order for btrfs to deem it useful. If firebird's 16k writes are not
25% compressible then it won't compress. It also depends on whether it
issues fsync after every write to ensure consistency meaning it won't
allow more data to accumulate.

> $ 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
> 

  reply	other threads:[~2020-09-01  5:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30  9:35 new database files not compressed Hamish Moffatt
2020-08-31  2:20 ` Eric Wong
2020-08-31  2:44   ` Hamish Moffatt
2020-08-31  3:15   ` A L
2020-08-31  3:47 ` Zygo Blaxell
2020-08-31  8:53   ` Hamish Moffatt
2020-08-31  9:25     ` Nikolay Borisov
2020-08-31 10:40       ` Hamish Moffatt
2020-08-31 10:47         ` Nikolay Borisov
2020-08-31 12:56           ` Hamish Moffatt
2020-08-31 11:15     ` Roman Mamedov
2020-08-31 12:54       ` Hamish Moffatt
2020-08-31 12:57         ` Nikolay Borisov
2020-08-31 23:50           ` Hamish Moffatt
2020-09-01  5:15             ` Nikolay Borisov [this message]
2020-09-01  8:55               ` Hamish Moffatt
2020-09-02  0:32                 ` Hamish Moffatt
2020-09-02  5:57                   ` Nikolay Borisov
2020-09-02  6:05                     ` Hamish Moffatt
2020-09-02  6:10                       ` Nikolay Borisov
2020-09-02  9:57                     ` A L
2020-09-02 10:09                       ` Nikolay Borisov
2020-09-03 15:04                         ` A L
2020-09-02 16:16                       ` Zygo Blaxell
2020-09-03 12:53                         ` Hamish Moffatt
2020-09-03 19:44                           ` Zygo Blaxell
2020-09-04  8:07                             ` Hamish Moffatt
2020-09-05  4:07                               ` Zygo Blaxell
2020-09-03 15:03                         ` A L
2020-09-03 21:52                           ` Zygo Blaxell
2020-09-01  1:43 ` Chris Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0bf29a8c-23b2-26f4-2efd-2e82f38c437d@suse.com \
    --to=nborisov@suse.com \
    --cc=ce3g8jdj@umail.furryterror.org \
    --cc=hamish-btrfs@moffatt.email \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rm@romanrm.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox