All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert White <rwhite@pobox.com>
To: russell@coker.com.au
Cc: "sys.syphus" <syssyphus@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: Balance & scrub & defrag
Date: Thu, 11 Dec 2014 17:31:12 -0800	[thread overview]
Message-ID: <548A4560.9010105@pobox.com> (raw)
In-Reply-To: <44336672.dmUL7ANCyf@russell.coker.com.au>

On 12/11/2014 05:00 PM, Russell Coker wrote:
> On Wed, 10 Dec 2014 17:17:28 Robert White wrote:
>> A _monthly_ scrub is maybe worth scheduling if you have a lot of churn
>> in your disk contents.
>
> I do weekly scrubs.  I recently had 2 disks in a RAID-1 array develop read
> errors within a month of each other.  The first scrub after replacing sdb
> revealed an error on sdc!

You need to buy better disks. 8-)

I use SMART (smartmontools etc) and its tests to keep track of and warn 
me of such issues. It's way more likely to catch incipient media 
failures long before scrub would. It's also more likely to correct 
situations before they become visible to userspace. Its also a way 
better full-platter scan that involves less real time delay and won't 
bog down a running system.

I reserve scrub for after maintenance and the occasional look-see.

But whatever works for you.

>
> The problem with running out of metadata space requires a need for an
> occasional data balance.  If you set it to only balance chunks that are less
> than 10% used then it doesn't take much time.

In very recent kernels the empty extent remover will take up most of 
this burden.

A shallow balance is fast, but you are missing most of its potential 
benefits at that point. I wash my clothes instead of just taking a lint 
brush to them. Half measures, repeated, lead to more and more fractional 
results.

Every time you sweep a 10% full extent into a another extent far, far 
away you are perturbing your locality and probably shaving a little off 
of probable peak performance. It's the equivalent of organizing your 
sock drawer by just taking all the socks out of the dryer in a lump and 
cramming them into the back of the drawer. That is you are moving the 
most-changed items back to pack them against the least-changed ones. The 
natural lay of the filesystem is to spread out and churn. Repeatedly 
smashing it down is just going to wrinkle your data.

If you are getting anywhere near running out of metadata extents on any 
kind of regular basis then you need to reexamine your entire deal. Make 
sure you are running a recent kernel with the reclaim update. Do a full 
balance _once_ and then leave it alone. Maybe consider autodefrag if 
your file load is compatible (not a lot of VMs and RDBMS extents).

Of course if this is your pirate warez machine and you are regularly 
passing torrents through it, then you just need more space and better 
delete discipline.


  reply	other threads:[~2014-12-12  1:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10 22:15 Balance & scrub & defrag sys.syphus
2014-12-11  1:17 ` Robert White
2014-12-12  1:00   ` Russell Coker
2014-12-12  1:31     ` Robert White [this message]
2014-12-12  9:17       ` Erkki Seppala
2014-12-12 13:32         ` Robert White
2014-12-13  5:15         ` Zygo Blaxell
2014-12-11  8:33 ` Duncan
2014-12-12  4:32 ` Zygo Blaxell
  -- strict thread matches above, loose matches on Subject: below --
2014-12-12  9:49 Tomasz Chmielewski

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=548A4560.9010105@pobox.com \
    --to=rwhite@pobox.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=russell@coker.com.au \
    --cc=syssyphus@gmail.com \
    /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.