All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henk Slager <eye1tm@gmail.com>
To: Marat Khalili <mkh@rqc.ru>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Is autodefrag recommended?
Date: Mon, 4 Sep 2017 12:23:51 +0200	[thread overview]
Message-ID: <CAPmG0jaZRAQM_EHzEp96gC1TuaZHnqHcZ2VdiAz=ecJL5Yzs7A@mail.gmail.com> (raw)
In-Reply-To: <710ec5d1-adbf-4ce5-50a5-8b8266ccb672@rqc.ru>

On Mon, Sep 4, 2017 at 11:31 AM, Marat Khalili <mkh@rqc.ru> wrote:
> Hello list,
> good time of the day,
>
> More than once I see mentioned in this list that autodefrag option solves
> problems with no apparent drawbacks, but it's not the default. Can you
> recommend to just switch it on indiscriminately on all installations?

Of course it has drawbacks, it depends on the use-cases on the
filesystem what your trade-off is. If the filesystem is created log
time ago and has 4k leafes the on HDD over time you get exessive
fragmentation and scattered 4k blocks all over the disk for a file
with a lot random writes (standard CoW for whole fs), like a 50G vm
image, easily 500k extents.

With autodefrag on from the beginning of fs creation, most
extent/blocksizes will be 128k or 256k in that order and then amount
of extents for the same vm image is roughly 50k. So statistically, the
average blocksize is not 4k but 128k, which is at least less free
space fragmentation (I use SSD caching of HDD otherwise also those 50k
extents result in totally unacceptable performance). But also for
newer standard 16k leafes, it is more or less the same story.

The drawbacks for me are:
1. I use nightly differential snapshotting for backup/replication over
a metered mobile network link, and this autodefrag causes a certain
amount of unnessccesaty fake content difference due to send|receive
based on CoW. But the amount of extra datavolume it causes is still
acceptable. If I would let the guest OS defragment its fs inside the
vm image for example, then the datavolume per day becomes
unacceptable.
2. It causes extra HDD activity, so noise, powerconsumption etc, which
might be unacceptable for some use-cases.

> I'm currently on kernel 4.4, can switch to 4.10 if necessary (it's Ubuntu
> that gives us this strange choice, no idea why it's not 4.9). Only spinning
> rust here, no SSDs.
Kernel 4.4 is new enough w.r.t. autodefrag, but if you can switch to
4.8 or newer, I would do so.

  reply	other threads:[~2017-09-04 10:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04  9:31 Is autodefrag recommended? Marat Khalili
2017-09-04 10:23 ` Henk Slager [this message]
2017-09-04 10:34 ` Duncan
2017-09-04 11:09   ` Henk Slager
2017-09-04 22:27     ` Duncan
2017-09-04 10:54 ` Hugo Mills
2017-09-05 11:45   ` Austin S. Hemmelgarn
2017-09-05 12:49     ` Henk Slager
2017-09-05 13:00       ` Austin S. Hemmelgarn
2017-09-05 12:36 ` A L
2017-09-05 14:01 ` Is autodefrag recommended? -- re-duplication??? Marat Khalili
2017-09-05 14:39   ` Hugo Mills

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='CAPmG0jaZRAQM_EHzEp96gC1TuaZHnqHcZ2VdiAz=ecJL5Yzs7A@mail.gmail.com' \
    --to=eye1tm@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mkh@rqc.ru \
    /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.