linux硬件raid 10 / lvm /虚拟机分区对齐和文件系统优化

Jas*_*ard 5 linux virtual-machines lvm hardware-raid partition-alignment

我一直在阅读有关分区对齐和文件系统优化(ext4 和 xfs)的所有内容,但仍然不够了解,无法有信心设置当前的配置。我剩下的困惑来自于 LVM 层以及我是否应该在来宾操作系统的文件系统上使用 raid 参数。

我的主要问题是:

  1. 当我使用“pvcreate --dataalignment”时,我是否使用为 RAID 上的文件系统计算的条带宽度(在我的情况下,ext4 为 128kB)、RAID 集的条带大小(256kB)、其他东西,或者我是否使用不需要这个吗?

  2. 当我在逻辑卷上的来宾中创建 ext2/3/4 或 xfs 文件系统时,是否应该添加底层 RAID 的设置(例如 mkfs.ext4 -b 4096 -E stride=64,stripe-width=128)?

  3. 有人在我下面的设置中看到任何明显的错误吗?我现在正在运行一些基准测试,但还没有做足够的工作来开始比较结果。

我在 3ware 9750-4i 控制器上有 4 个 RAID 10 驱动器(更多详细信息请参阅下面的设置),在 /dev/sda 处有一个 6.0TB 设备。这是我的分区表:

Model: LSI 9750-4i DISK (scsi)
Disk /dev/sda: 5722024MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start      End         Size        File system     Name      Flags
 1      1.00MiB    257MiB      256MiB      ext4            BOOTPART  boot
 2      257MiB     4353MiB     4096MiB     linux-swap(v1)
 3      4353MiB    266497MiB   262144MiB   ext4
 4      266497MiB  4460801MiB  4194304MiB

Partition 1 is to be the /boot partition for my xen host.
Partition 2 is swap.
Partition 3 is to be the root (/) for my xen host.
Partition 4 is to be (the only) physical volume to be used by LVM
(for those who are counting, I left about 1.2TB unallocated for now)
Run Code Online (Sandbox Code Playgroud)

对于我的 Xen 来宾,我通常创建所需大小的逻辑卷并将其呈现给来宾,以便他们根据需要进行分区。我知道还有其他方法可以解决这个问题,但这种方法最适合我的情况。

Here's the hardware of interest on my CentOS 6.3 Xen Host:

4x Seagate Barracuda 3TB ST3000DM001 Drives (sector size: 512 logical/4096 physical)

3ware 9750-4i w/BBU  (sector size reported: 512 logical/512 physical)
    All four drives make up a RAID 10 array.
    Stripe: 256kB
    Write Cache enabled
    Read Cache: intelligent
    StoreSave: Balance
Run Code Online (Sandbox Code Playgroud)

谢谢!

Gor*_*bić 0

具体回答您的问题:

  1. 条带宽度 (256KB)

  2. 是的

  3. 我能想到的有两件事没有提到:

3.1) 您并不是从顶层 I/O 大小开始,而这才是您需要开始的地方。如果您的应用程序主要以 x KB 块写入,那么您需要针对 x KB 块对整个存储堆栈进行顶部优化和对齐。

3.2) 您还没有涉及块组对齐(ext* 文件系统的 -g 选项)。您需要调整块组大小,以避免所有块组在同一磁盘上启动,从而创建巨大的热点并使该磁盘成为瓶颈。

我写了一篇关于这个主题的文章,解释了如何实现最佳存储堆栈对齐,您可能会发现它很有用。