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.

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to