All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Christian Theune <ct@flyingcircus.io>
Cc: Hugo Mills <hugo@carfax.org.uk>, linux-btrfs@vger.kernel.org
Subject: Re: Shrinking a device - performance?
Date: Mon, 27 Mar 2017 10:17:26 -0400	[thread overview]
Message-ID: <bf772a48-5181-d1ea-f7a7-5dffc524e2de@gmail.com> (raw)
In-Reply-To: <333BD058-6365-43C3-8070-E6267936D98D@flyingcircus.io>

On 2017-03-27 09:54, Christian Theune wrote:
> Hi,
>
>> On Mar 27, 2017, at 3:50 PM, Christian Theune <ct@flyingcircus.io> wrote:
>>
>> Hi,
>>
>>> On Mar 27, 2017, at 3:46 PM, Austin S. Hemmelgarn <ahferroin7@gmail.com> wrote:
>>>>
>>>>> Something I’d like to verify: does having traffic on the volume have
>>>>> the potential to delay this infinitely? I.e. does the system write
>>>>> to any segments that we’re trying to free so it may have to work on
>>>>> the same chunk over and over again? If not, then this means it’s
>>>>> just slow and we’re looking forward to about 2 months worth of time
>>>>> shrinking this volume. (And then again on the next bigger server
>>>>> probably about 3-4 months).
>>>>
>>>>  I don't know. I would hope not, but I simply don't know enough
>>>> about the internal algorithms for that. Maybe someone else can confirm?
>>> I'm not 100% certain, but I believe that while it can delay things, it can't do so infinitely.  AFAICT from looking at the code (disclaimer: I am not a C programmer by profession), it looks like writes to chunks that are being compacted or moved will go to the new location, not the old one, but writes to chunks which aren't being touched by the resize currently will just go to where the chunk is currently.  Based on this, lowering the amount of traffic to the FS could probably speed things up a bit, but it likely won't help much.
>>
>> I hoped that this is the strategy implemented, otherwise it would end up in an infinite cat-and-mouse game. ;)
>>
>>>>> (Background info: we’re migrating large volumes from btrfs to xfs
>>>>> and can only do this step by step: copying some data, shrinking the
>>>>> btrfs volume, extending the xfs volume, rinse repeat. If someone
>>>>> should have any suggestions to speed this up and not having to think
>>>>> in terms of _months_ then I’m all ears.)
>>>>
>>>>  All I can suggest is to move some unused data off the volume and do
>>>> it in fewer larger steps. Sorry.
>>> Same.
>>>
>>> The other option though is to just schedule a maintenance window, nuke the old FS, and restore from a backup.  If you can afford to take the system off-line temporarily, this will almost certainly go faster (assuming you have a reasonably fast means of restoring backups).
>>
>> Well. This is the backup. ;)
>
> One strategy that does come to mind: we’re converting our backup from a system that uses reflinks to a non-reflink based system. We can convert this in place so this would remove all the reflink stuff in the existing filesystem and then we maybe can do the FS conversion faster when this isn’t an issue any longer. I think I’ll
One other thing that I just thought of:
For a backup system, assuming some reasonable thinning system is used 
for the backups, I would personally migrate things slowly over time by 
putting new backups on the new filesystem, and shrinking the old 
filesystem as the old backups there get cleaned out.  Unfortunately, 
most backup software I've seen doesn't handle this well, so it's not all 
that easy to do, but it does save you from having to migrate data off of 
the old filesystem, and means you don't have to worry as much about the 
resize of the old FS taking forever.

  reply	other threads:[~2017-03-27 14:19 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 11:17 Shrinking a device - performance? Christian Theune
2017-03-27 13:07 ` Hugo Mills
2017-03-27 13:20   ` Christian Theune
2017-03-27 13:24     ` Hugo Mills
2017-03-27 13:46       ` Austin S. Hemmelgarn
2017-03-27 13:50         ` Christian Theune
2017-03-27 13:54           ` Christian Theune
2017-03-27 14:17             ` Austin S. Hemmelgarn [this message]
2017-03-27 14:49               ` Christian Theune
2017-03-27 15:06                 ` Roman Mamedov
2017-04-01  9:05                   ` Kai Krakow
2017-03-27 14:14           ` Austin S. Hemmelgarn
2017-03-27 14:48     ` Roman Mamedov
2017-03-27 14:53       ` Christian Theune
2017-03-28 14:43         ` Peter Grandi
2017-03-28 14:50           ` Tomasz Kusmierz
2017-03-28 15:06             ` Peter Grandi
2017-03-28 15:35               ` Tomasz Kusmierz
2017-03-28 16:20                 ` Peter Grandi
2017-03-28 14:59           ` Peter Grandi
2017-03-28 15:20             ` Peter Grandi
2017-03-28 15:56           ` Austin S. Hemmelgarn
2017-03-30 15:55             ` Peter Grandi
2017-03-31 12:41               ` Austin S. Hemmelgarn
2017-03-31 17:25                 ` Peter Grandi
2017-03-31 19:38                   ` GWB
2017-03-31 20:27                     ` Peter Grandi
2017-04-01  0:02                       ` GWB
2017-04-01  2:42                         ` Duncan
2017-04-01  4:26                           ` GWB
2017-04-01 11:30                             ` Peter Grandi
2017-03-30 15:00           ` Piotr Pawłow
2017-03-30 16:13             ` Peter Grandi
2017-03-30 22:13               ` Piotr Pawłow
2017-03-31  1:00                 ` GWB
2017-03-31  5:26                   ` Duncan
2017-03-31  5:38                     ` Duncan
2017-03-31 12:37                       ` Peter Grandi
2017-03-31 11:37                   ` Peter Grandi
2017-03-31 10:51                 ` Peter Grandi
2017-03-27 11:51 Christian Theune
2017-03-27 12:55 ` Christian Theune

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=bf772a48-5181-d1ea-f7a7-5dffc524e2de@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=ct@flyingcircus.io \
    --cc=hugo@carfax.org.uk \
    --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.