All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Straub <lukasstraub2@web.de>
To: "Konstantin V. Gavrilenko" <k.gavrilenko@arhont.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: CEPH to BTRFS over NFS results in no compression
Date: Sun, 2 Jan 2022 14:08:33 +0000	[thread overview]
Message-ID: <20220102140833.2605a773@gecko> (raw)
In-Reply-To: <1056918704.2047.1641123173265.JavaMail.zimbra@arhont.com>

[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]

On Sun, 2 Jan 2022 11:32:53 +0000 (UTC)
"Konstantin V. Gavrilenko" <k.gavrilenko@arhont.com> wrote:

> Hi list, 
> 
> I have noticed an interesting and surprising behaviour of my BTRFS with regards to compression of the files and NFS. 
> 
> I have BTRFS RAID10 with 8 disks , that is mounted with the " nofail,noatime,space_cache=v2,compress-force=zstd:9,subvol=@cloudstack-secondary" flags and is exported via NFS. 
> 
> When I create a snapshot of a disk in Cloudstack from CEPH and save it to a secondary storage to this BTRFS RAID10 over NFS, the file does not compress, despite the compress-force mount option being set on FS 
> So in the below example, the file eeceaf0e-9780-408b-a748-1495d517a9b6 was copied over NFS and is not compressed. When I copy the same file directly on a host, it does get compressed pretty well, as per example below. 
> 
> [...]
> 
> 
> So what I have checked so far what works 
> - after the original files is copied over NFS, the copy of the file using #cp gets compressed. 
> - after the original files is copied over NFS, the original file can be compressed using #btrfs defrag -czstd option 
> - If I copy the original file to some other host, and copy it back via NFS using cp, it does get compressed. 
> 
> So the problem seems to appear only when the file is exported from Ceph and copied to NFS. 
> 
> Any hints what could be causing such a behaviour? 
> 
> 
> 
> Yours sincerely, 
> Kos
> 

Btrfs doesn't compress direct-io writes. This suggests that whatever you use for "I create a snapshot of a disk in Cloudstack from CEPH and save it to a secondary storage to this BTRFS RAID10 over NFS", it writes with O_DIRECT.

Regards,
Lukas Straub

-- 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-01-02 14:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 11:32 CEPH to BTRFS over NFS results in no compression Konstantin V. Gavrilenko
2022-01-02 14:08 ` Lukas Straub [this message]
2022-01-02 14:19   ` Konstantin V. Gavrilenko

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=20220102140833.2605a773@gecko \
    --to=lukasstraub2@web.de \
    --cc=k.gavrilenko@arhont.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.