On Wed, Jul 6, 2016 at 5:22 PM, Kai Krakow <hurikhan77@xxxxxxxxx> wrote: > The current implementation of RAID0 in btrfs is probably not very > optimized. RAID0 is a special case anyways: Stripes have a defined > width - I'm not sure what it is for btrfs, probably it's per chunk, so > it's 1GB, maybe it's 64k **. Stripe element (a.k.a. strip, a.k.a. md chunk) size in Btrfs is fixed at 64KiB. >That means your data is usually not read > from multiple disks in parallel anyways as long as requests are below > stripe width (which is probably true for most access patterns except > copying files) - there's no immediate performance benefit. Most any write pattern benefits from raid0 due to less disk contention, even if the typical file size is smaller than stripe size. Parallelization is improved even if it's suboptimal. This is really no different than md raid striping with a 64KiB chunk size. On Btrfs, it might be that some workloads benefit from metadata raid10, and others don't. I also think it's hard to estimate without benchmarking an actual workload with metadata as raid1 vs raid10. > So I guess, at this stage there's no big difference between RAID1 and > RAID10 in btrfs (except maybe for large file copies), not for single > process access patterns and neither for multi process access patterns. > Btrfs can only benefit from RAID1 in multi process access patterns > currently, as can btrfs RAID0 by design for usual small random access > patterns (and maybe large sequential operations). But RAID1 with more > than two disks and multi process access patterns is more or less equal > to RAID10 because stripes are likely to be on different devices anyways. I think that too would need to be benchmarked and I think it'd need to be aged as well to see the effect of both file and block group free space fragmentation. The devil will be in really minute details, all you have to do is read a few weeks of XFS list stuff with people talking about optimization or bad performance and almost always it's not the fault of the file system. And when it is, it depends on the kernel version as XFS has had substantial changes even over its long career, including (somewhat) recent changes for metadata heavy workloads. > In conclusion: RAID1 is simpler than RAID10 and thus its less likely to > contain flaws or bugs. I don't know about that. I think it's about the same. All multiple device support, except raid56, was introduced at the same time practically from day 2. Btrfs raid1 and raid10 tolerate only exactly 1 device loss, *maybe* two if you're very lucky, so neither of them are really scalable. -- Chris Murphy -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
