SSD (Intel 530) RAID 10 读/写速度非常慢

Ara*_*Ara 11 linux ssd hp hp-smart-array hp-proliant

解释:

我们有一个服务器:

  • 型号:HP ProLiant DL160 G6
  • 4 个 240GB 固态硬盘 (RAID-10)
  • 72GB DDR3 内存
  • 2 x L5639
  • HP P410 RAID 控制器(256MB,V6.40,ROM 版本:8.40.41.00)

SSD 驱动器是 4 个全新的 2.5" Intel 530,读取速度为 540MB/s,写入速度为 490MB/s

  • CentOS 6
  • 文件系统是 ext4

但这是raid 10读取速度的测试结果:

hdparm -t /dev/sda

/dev/sda:
 Timing buffered disk reads:  824 MB in  3.00 seconds = 274.50 MB/sec
[root@localhost ~]# hdparm -t /dev/mapper/vg_localhost-lv_root

/dev/mapper/vg_localhost-lv_root:
 Timing buffered disk reads:  800 MB in  3.01 seconds = 266.19 MB/sec
Run Code Online (Sandbox Code Playgroud)

这是为了写入速度:

dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 4.91077 s, 109 MB/s
Run Code Online (Sandbox Code Playgroud)

我们希望raid 10 的读取速度为1GB,但270MB 甚至不是单个磁盘的速度!

问题:

  1. 为什么这么慢?
  2. 是不是因为 RAID 控制器?

更新 1 - 相同的读/写速度:

在更改答案中提到的一些设置后,我得到以下结果:

(有人知道为什么它显示 4GB 而不是 400MB 作为读取速度吗?!)

编辑:看起来命令是错误的,我们应该对这个数量的内存使用 -s144g,这就是为什么它显示 4GB(如 ewwhite 的评论中所建议的)

[root@192 ~]# iozone -t1 -i0 -i1 -i2 -r1m -s56g
        Iozone: Performance Test of File I/O
                Version $Revision: 3.408 $
                Compiled for 64 bit mode.
                Build: linux

        Record Size 1024 KB
        File size set to 58720256 KB
        Command line used: iozone -t1 -i0 -i1 -i2 -r1m -s56g
        Output is in Kbytes/sec
        Each process writes a 58720256 Kbyte file in 1024 Kbyte records

        Children see throughput for  1 initial writers  =  135331.80 KB/sec
        Children see throughput for  1 rewriters        =  124085.66 KB/sec
        Children see throughput for  1 readers          = 4732046.50 KB/sec
        Children see throughput for 1 re-readers        = 4741508.00 KB/sec
        Children see throughput for 1 random readers    = 4590884.50 KB/sec
        Children see throughput for 1 random writers    =  124082.41 KB/sec
Run Code Online (Sandbox Code Playgroud)

但旧hdparm -t /dev/sda命令仍然显示:

定时缓冲磁盘读取:3.00 秒内 810 MB = 269.85 MB/秒

更新 2(tuned-utils 包)-读取速度现在为 600MB/s:

终于有了一些希望,我们已经禁用了 RAID 控制器的缓存,并在没有运气的情况下更早地做了一些其他事情,但是因为我们重新加载了服务器并再次安装了操作系统,我们忘记按照 ewwhite 的回答中的建议安装“tu​​ned-utils”(谢谢ewwhite 用于您建议的这个很棒的包)

安装tuned-utils并选择enterprise-storage配置文件后,读取速度现在约为 600MB/s+,但写入速度仍然很慢(~160MB)(:

这是iozone -t1 -i0 -i1 -i2 -r1m -s144g命令的结果:

    Children see throughput for  1 initial writers  =  165331.80 KB/sec
    Children see throughput for  1 rewriters        =  115734.91 KB/sec
    Children see throughput for  1 readers          =  719323.81 KB/sec
    Children see throughput for 1 re-readers        =  732008.56 KB/sec
    Children see throughput for 1 random readers    =  549284.69 KB/sec
    Children see throughput for 1 random writers    =  116389.76 KB/sec
Run Code Online (Sandbox Code Playgroud)

即使使用hdparm -t /dev/sda命令,我们也有:

定时缓冲磁盘读取:3.00 秒内 1802 MB = 600.37 MB/秒

对于非常慢的写入速度有什么建议吗?

更新 3 - 评论中要求的一些信息:

写入速度仍然很低(~150MB/s,甚至不是单个磁盘的 1/3)

df -h和 的输出fdisk -l

[root@192 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       441G  3.2G  415G   1% /
tmpfs            36G     0   36G   0% /dev/shm


[root@192 ~]# fdisk -l
Disk /dev/sda: 480.0 GB, 480047620096 bytes
255 heads, 63 sectors/track, 58362 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00040c3c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       58363   468795392   83  Linux
Run Code Online (Sandbox Code Playgroud)

eww*_*ite 16

虽然这里的另一个答案有一些要点,但您的具体问题是由于平台限制和操作系统配置:

  • 在 HP Smart Array P410 RAID 控制器上使用消费级 SATA SSD 会限制您的吞吐量。SATA 磁盘在这些控制器上以 3.0Gbps (3G) 而不是 6.0Gbps (6G) 运行。所以这是影响英特尔固态盘读取速度的障碍;每个驱动器 300MB/s 或更少。

  • Smart Array P410 控制器在与 SSD 一起使用时具有特定要求和最佳实践。简而言之,控制器能够达到 50,000 IOPS,禁用 SSD 卷的阵列加速器,性能最高可达约 6 个驱动器。

  • 磁盘性能并不总是与顺序读/写速度有关。尝试使用合适的工具(如iozonebonnie++ )进行基准测试。您仍然可以获得多个驱动器的随机 I/O 优势。

  • 在操作系统级别,安装tuned-utils包并将配置enterprise-performance文件设置为从文件系统中删除写入障碍,并为您的设置设置正确的I/O 升降机。此处的其他问题也涵盖了这一点。

  • 看起来您正在使用 LVM。这也会有影响...

这是在同一个 HP Smart Array P410 RAID 控制器上运行四个 消费级 6G SATA SSD(降档至 3G 速度)的 G7 ProLiant 的 iozone 报告。

您应该看到大约 470MB/s 的写入和 650MB/s+ 的读取。

[root@mdmarra /data/tmp]# iozone -t1 -i0 -i1 -i2 -r1m -s56g
        Iozone: Performance Test of File I/O
                Version $Revision: 3.394 $
                Compiled for 64 bit mode.
                Build: linux 

        Record Size 1024 KB
        File size set to 58720256 KB
        Command line used: iozone -t1 -i0 -i1 -i2 -r1m -s56g
        Output is in Kbytes/sec
        Each process writes a 58720256 Kbyte file in 1024 Kbyte records

        Children see throughput for  1 initial writers  =  478209.81 KB/sec
        Children see throughput for  1 rewriters        =  478200.84 KB/sec
        Children see throughput for  1 readers          =  677397.69 KB/sec
        Children see throughput for 1 re-readers        =  679523.88 KB/sec
        Children see throughput for 1 random readers    =  437344.78 KB/sec
        Children see throughput for 1 random writers    =  486254.41 KB/sec
Run Code Online (Sandbox Code Playgroud)

  • 好的,对于 DL160 G6,您应该有两根电缆从 RAID 控制器连接到驱动器背板……8 个驱动器插槽。您的问题是驱动器吞吐量、您的测试方法和服务器的设置。尝试我在答案中列出的其他建议。 (2认同)

Rom*_*man 12

哦,亲爱的,从哪里开始?

涉及的内容太多了,您需要对所有内容都有很好的了解。只是将一堆磁盘扔到 RAID 控制器上不会产生您正在寻找的结果。

这不容易回答。但至少,以下是您必须查看的内容列表:

  • 控制器甚至具有所需的吞吐量吗?(-> 数据表)
  • 控制器是否有足够的带宽到主机(它有,即使在 v1.0,因为它是 x8)
  • 系统的芯片组是否有足够的吞吐量(CPU-Controller)?(未知)
  • 您指示控制器采用什么写入策略?(这是最有可能咬到你的
  • 一切都对齐了吗(分区开始、LV、PV)?
  • 块大小是否一致?(RAID 条带大小、块大小、FS 块……)
  • 文件系统是否针对 RAID 设置进行了优化?(级别和块大小)

由于您对整个 RAID(不考虑 FS)的吞吐量明显低于单个磁盘,因此您可能错误地设置了写入策略;控制器可能正在等待所有磁盘确认写入(除非您已为控制器电池上的 RAM 提供支持,否则这可能最符合您的利益)。