Skip to contentSkip to conversation

Questions on using BtrFS for fileserver

DISCUSSION M G Berberich 8 participants 9 messages Aug 19, 2014 – Aug 21, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello,

we are thinking about using BtrFS on standard hardware for a fileserver with about 50T (100T raw) of storage (25×4TByte).

This is what I understood so far. Is this right?

· incremental send/receive works.

· There is no support for hotspares (spare disks that automatically
replaces faulty disk).

· BtrFS with RAID1 is fairly stable.

· RAID 5/6 spreads all data over all devices, leading to performance
problems on large diskarrays, and there is no option to limit the numbers of disk per stripe so far.

Some questions:

· There where reports, that bcache with btrfs leads to corruption. Is
this still so?

· If a disk failes, does BtrFS rebalance automatically? (This would
give a a kind o hotspare behavior)

· Besides using bcache, are there any possibilities to boost
performance by adding (dedicated) cache-SSDs to a BtrFS?

· Are there any reports/papers/web-pages about BtrFS-systems this size
in use? Praises, complains, performance-reviews, whatever…

MfG
bmg

Signature · 3 lines
„Des is völlig wurscht, was heut beschlos- | M G Berberich
 sen wird: I bin sowieso dagegn!“          | [email protected]
(SPD-Stadtrat Kurt Schindler; Regensburg)  | www.fmi.uni-passau.de/~berberic
#1 lore raw
Quoted 2 lines

· Besides using bcache, are there any possibilities to boost
performance by adding (dedicated) cache-SSDs to a BtrFS?

dm-cache is in the mainline kernel and lvm2 recently added support to make devicemapper configuration automatic. In my opinion, dm-cache is a little easier to use because you can add/remove/resize the cache without recreating the filesystem. If you're interested, take a peek at the man page for lvmcache.

- Kyle

#2 lore raw
In reply to M G Berberich
Quoted 14 lines · M G Berberich

Hello,

we are thinking about using BtrFS on standard hardware for a fileserver with about 50T (100T raw) of storage (25×4TByte).

This is what I understood so far. Is this right?

· incremental send/receive works.

· There is no support for hotspares (spare disks that automatically
replaces faulty disk).

· BtrFS with RAID1 is fairly stable.

Quoted 8 lines

· RAID 5/6 spreads all data over all devices, leading to performance
problems on large diskarrays, and there is no option to limit the numbers of disk per stripe so far.

Some questions:

· There where reports, that bcache with btrfs leads to corruption. Is
this still so?

Based on some testing I did last month, bcache with anything has the potential to cause data corruption.

Quoted 3 lines

· If a disk failes, does BtrFS rebalance automatically? (This would
give a a kind o hotspare behavior)

No, but it wouldn't be hard to write a simple monitoring program to do this from userspace. IIRC, the big issue is that you need to add a device in-place of the failed one for the re-balance to work.

Quoted 3 lines

· Besides using bcache, are there any possibilities to boost
performance by adding (dedicated) cache-SSDs to a BtrFS?

Like mentioned in one of the other responses, I would suggest looking into dm-cache. BTRFS itself does not have any functionality for this, although there has been talk of implementing device priorities for reads, which could provide a similar performance boost.

Quoted 3 lines

· Are there any reports/papers/web-pages about BtrFS-systems this size
in use? Praises, complains, performance-reviews, whatever…

While it doesn't quite fit the description, I have had very good success with a very active 2TB BTRFS RAID10 filesystem consisting of BTRFS on four unpartitioned 1TB SATA III hard drives. The filesystem gets in excess of 100GB of data written to it each day (almost all rewrites however), and is what I use for /home, /var/log, and /var/lib, and I've had no issues with it that were caused by BTRFS, and in-fact, the very fact that it uses BTRFS helped me recover data when the storage controller they are connected to went bad. On average, I get about 125% of raw disk performance on writes, and about 110% on reads.

If you are using a very large number of disks, then I would not suggest that you use BTRFS RAID10, but instead BTRFS RAID1, as RAID10 will try to stripe things across ALL of the devices in the filesystem, and unless you have no more than about four times as many disks as storage controllers (that is, each controller has no more than four disks attached to it), the overhead outweighs the benefit of striping the data.

Also, just to make sure it's clear, in BTRFS RAID1, each block gets written EXACTLY twice. On the plus side though, this means that if you do set-up a caching mechanism, you may be able to keep most of the array spun down a majority of the time.

#3 lore raw
In reply to M G Berberich
Quoted 5 lines · M G Berberich

Hello,

we are thinking about using BtrFS on standard hardware for a fileserver with about 50T (100T raw) of storage (25×4TByte).

I would recommend carefully reading this thread titled: "1 week to rebuid 4x 3TB raid10 is a long time!"

http://comments.gmane.org/gmane.comp.file-systems.btrfs/36969

There are multiple methods for replacing a device in a Btrfs RAID array. If I understand the conclusions of this thread, you might still expect 12-14 hours to rebuild after replacing a 4 TByte device, assuming you use the optimal replace commands.

With 25 devices, that leaves an uncomfortable period of time where another device might fail.

#4 lore raw
In reply to M G Berberich

Hi,

On 08/19/2014 06:21 PM, M G Berberich wrote:> · Are there any reports/papers/web-pages about BtrFS-systems this size

Quoted 1 line

in use? Praises, complains, performance-reviews, whatever…

I don't know about papers or benchmarks but few weeks ago there was a guy who has problem with really long mounting with btrfs with similiar size.
https://www.mail-archive.com/[email protected]/msg36226.html

And I would not recommend 3TB disks. *I'm not btrfs dev* but as far as I know there is a quite different between rebuilding disk on real RAID and btrfs RAID. The problem is btrfs has RAID on filesystem level not on hw level so there is bigger mechanical overheat on drives and thus it take significantli longer than regular RAID.

--
b.

#5 lore raw
Quoted 10 lines · Andrej Manduch

Hi,

On 08/19/2014 06:21 PM, M G Berberich wrote:> · Are there any reports/papers/web-pages about BtrFS-systems this size

Quoted 1 line

in use? Praises, complains, performance-reviews, whatever…

I don't know about papers or benchmarks but few weeks ago there was a guy who has problem with really long mounting with btrfs with similiar size.
https://www.mail-archive.com/[email protected]/msg36226.html

Quoted 5 lines

And I would not recommend 3TB disks. *I'm not btrfs dev* but as far as I know there is a quite different between rebuilding disk on real RAID and btrfs RAID. The problem is btrfs has RAID on filesystem level not on hw level so there is bigger mechanical overheat on drives and thus it take significantli longer than regular RAID.

It really suprises me that so many people come to this conclusion, but maybe they don't provide as much slack space as I do on my systems. In general you will only have a longer rebuild on BTRFS than on hardware RAID if the filesystem is more than about 50% full. On my desktop array (4x 1TB disks using BTRFS RAID10), I've replaced disks before and it took less than an hour for the operation. Of course that array is usually not more than 10% full. Interestingly, it took less time to rebuild this array the last time I lost a disk than it did back when it was 3x 1TB disks in a BTRFS RAID1, so things might improve overall with a larger number of disks in the array.

#6 lore raw
In reply to M G Berberich
Quoted 1 line · On Tue, 19 Aug 2014 18:21:52 +0200 M G Berberich <[email protected]>…

· BtrFS with RAID1 is fairly stable.

Maybe, but it's not optimized for performance: reads are not balanced in the most optimal way, and writes may end up being submitted sequentially rather than in parallel to two devices, resulting in write performance that's way less than that of a single device.

Quoted 3 lines

· RAID 5/6 spreads all data over all devices, leading to performance
problems on large diskarrays, and there is no option to limit the numbers of disk per stripe so far.

AFAIK Btrfs RAID 5/6 is not yet ready to be used in a production environment;

In your case I would recommend considering Btrfs on top of two 12-disk mdadm RAID6 arrays, or three 8-disk ones, leaving one HDD as a shared hot spare.

To join the mdadm arrays into a larger block device you can use either LVM, or Btrfs itself, with the "single" profile for data.

Signature · 2 lines
With respect,
Roman
#7 lore raw
In reply to M G Berberich
Quoted 1 line · M G Berberich

· incremental send/receive works.

Yes.

Quoted 2 lines

· There is no support for hotspares (spare disks that automatically
replaces faulty disk).

Correct

Quoted 7 lines

· BtrFS with RAID1 is fairly stable.

From what I know.

· RAID 5/6 spreads all data over all devices, leading to performance
problems on large diskarrays, and there is no option to limit the numbers of disk per stripe so far.

Not sure about the performance issue, but either way, don't use RAID5/6 with btrfs for anything else than playing around. The code is not finished.

Quoted 2 lines

· If a disk failes, does BtrFS rebalance automatically? (This would
give a a kind o hotspare behavior)

No, not for raid5/6.

Quoted 2 lines

· Are there any reports/papers/web-pages about BtrFS-systems this size
in use? Praises, complains, performance-reviews, whatever…

Use md-raid5 which is known and true, and put btrfs on top. And still have backups, be ready for btrfs to become unusable (speed and/or deadlocks), get trashed, or some other problem.
It's not guaranteed to happen, but the odds are far from being 0 either, so either your data is throwaway, or have good backups.

Marc

Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901
#8 lore raw
In reply to M G Berberich
Quoted 8 lines · M G Berberich

we are thinking about using BtrFS on standard hardware for a fileserver with about 50T (100T raw) of storage (25×4TByte).

...

· Are there any reports/papers/web-pages about BtrFS-systems this size
in use? Praises, complains, performance-reviews, whatever…

For what it is worth, I am running two btrfs filesystems:
1. Primary: 25 TiB, hardware RAID-6, LVM, PCIex8 (11x3TB)
2. Backup : 25 TiB, software RAID-5, LUKS, USB 3.0 (8x4TB)

I am not using btrfs RAID (-d single -m dup), rather hardware or software MD. Neither are partitioned (as they are not bootable).

I do hourly / daily / weekly / monthly / yearly snapshots on subvolumes in the primary fs, and pruning excess snapshots (example: I only keep 24 hourly snapshots).

Currently using stock Fedora 20, though I try to keep the btrfs utility up-to-date by building from GIT when an updated RPM is not available.

Overall impressions of btrfs:

* Very resilient.

It has suffered many hardware-related panics and no data-loss or filesystem corruption has been detected. I maintain a backup, which includes hashes of everything, and also 5% par2 recovery for some critical data.

The data is fairly static though, with the vast majority of operations being reads.

* Much higher CPU load than ext4.

This exposes a known reset issue with the old 3Ware 9650SE-ML16 RAID controller. Switching to the NOOP IO scheduler helped reduce the load considerably, but it still can get quite high [even without LUKS].

CPU & motherboard replacement hardware is on-hand, and an upgrade is imminent (currently using an old Core2 Duo @ 3 GHz, 4 GiB DDR2).

* Slow to mount, but not an unreasonable amount.

~~ Andrew E. Mileski