找回密码
 立即注册
首页 业界区 业界 RAID10和RAID5性能对比测试

RAID10和RAID5性能对比测试

钤凑讪 3 小时前
4块磁盘做raid5 或 raid10,无缓存直接写入性能哪种方式更好?为此做了一个简单的测试对比,事实胜于雄辩,我们用实际测试数据来得出结论。
一、raid无缓存

3个文件系统:
  1. ---u01: hdd 4T*4 raid10,raid无缓存
  2. ---u02: hdd 4T*4 raid5,raid无缓存
  3. ---u03: ssd 447G*1
复制代码
测试结果如下:
  1. ./testdd.sh /u01 /u02 /u03 > testdd.log.`date +%Y%m%d%H%M` 2>&1 &
  2. vgraid10_local-lv01  7.3T  100G  7.2T   2% /u01 --- direct写入:38.7 MB/s direct读取:151 MB/s  cache写入:328 MB/s  cache读取:511 MB/s
  3. vgraid5_local-lv01    11T   88G   11T   1% /u02 --- direct写入:7.4 MB/s  direct读取:128 MB/s  cache写入:77.6 MB/s cache读取:700 MB/s
  4. vgssd_local-lv01     447G   65G  382G  15% /u03 --- direct写入:147 MB/s  direct读取:189 MB/s  cache写入:387 MB/s  cache读取:512 MB/s
复制代码
结论:

在无缓存(例如RAID卡禁用缓存、设置为Write Through模式,或使用无缓存的RAID卡)的情况下,针对4块磁盘的配置,RAID 10 的直接写入性能【38.7 MB/s】全面且大幅度地优于 RAID 5【7.4 MB/s】。
二、raid缓存模式

确认以上测试 u01/u02 是无缓存模式:
  1. [root@host2 ~]# lsblk
  2. NAME                   MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
  3. sdc                      8:32   0   7.3T  0 disk  
  4. └─vgraid10_local-lv01  253:3    0   7.3T  0 lvm   /u01
  5. sdd                      8:48   0  10.9T  0 disk  
  6. └─vgraid5_local-lv01   253:4    0  10.9T  0 lvm   /u02
  7. sdb                      8:16   0 447.1G  0 disk  
  8. └─vgssd_local-lv01     253:5    0   447G  0 lvm   /u03
复制代码
执行 arcconf getconfig 1 ld 显示 Logical Device number 0 和 1 的配置信息:
  1. [root@host2 ~]# arcconf getconfig 1 ld
  2. Controllers found: 1
  3. --------------------------------------------------------
  4. Logical device information
  5. --------------------------------------------------------
  6. Logical Device number 0
  7.    Logical Device name                        : vd1
  8.    Disk Name                                  : /dev/sdc (Disk0) (Bus: 1, Target: 0, Lun: 0)
  9.    Block Size of member drives                : 512 Bytes
  10.    Array                                      : 0
  11.    RAID level                                 : 10
  12.    Status of Logical Device                   : Optimal
  13.    Size                                       : 7630830 MB
  14.    Stripe-unit size                           : 256 KB
  15.    Full Stripe Size                           : 512 KB
  16.    Interface Type                             : Serial ATA
  17.    Device Type                                : Data
  18.    Boot Type                                  : None
  19.    Heads                                      : 255
  20.    Sectors Per Track                          : 32
  21.    Cylinders                                  : 65535
  22.    Caching                                    : Disabled
  23.    Mount Points                               : Not Mounted
  24.    LD Acceleration Method                     : None
  25.    SED Encryption                             : Disabled
  26.    Volume Unique Identifier                   : 600508B1001CF6173057FB8A85255004
  27. --------------------------------------------------------
  28.    Logical Device segment information
  29. --------------------------------------------------------
  30.    Segment                                    : Availability (SizeMB, Protocol, Type, Connector ID, Location) Serial Number
  31. --------------------------------------------------------
  32.    Group 0, Segment 0                         : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:2) WQB0BYF0
  33.    Group 0, Segment 1                         : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:4) WQB0B5PV
  34.    Group 1, Segment 0                         : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:3) WQB0B5V7
  35.    Group 1, Segment 1                         : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:5) V302WXYF
  36. Logical Device number 1
  37.    Logical Device name                        : vd2
  38.    Disk Name                                  : /dev/sdd (Disk0) (Bus: 1, Target: 0, Lun: 1)
  39.    Block Size of member drives                : 512 Bytes
  40.    Array                                      : 1
  41.    RAID level                                 : 5
  42.    Status of Logical Device                   : Optimal
  43.    Parity Initialization Status               : Completed
  44.    Size                                       : 11446245 MB
  45.    Stripe-unit size                           : 256 KB
  46.    Full Stripe Size                           : 768 KB
  47.    Interface Type                             : Serial ATA
  48.    Device Type                                : Data
  49.    Boot Type                                  : None
  50.    Heads                                      : 255
  51.    Sectors Per Track                          : 32
  52.    Cylinders                                  : 65535
  53.    Caching                                    : Disabled
  54.    Mount Points                               : Not Mounted
  55.    LD Acceleration Method                     : None
  56.    SED Encryption                             : Disabled
  57.    Volume Unique Identifier                   : 600508B1001CE4C11BEB914107DF0141
  58. --------------------------------------------------------
  59.    Array Physical Device Information
  60. --------------------------------------------------------
  61.    Device ID                                  : Availability (SizeMB, Protocol, Type, Connector ID, Location) Serial Number
  62. --------------------------------------------------------
  63.    Device 14                                  : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:6) V3039ZHF
  64.    Device 15                                  : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:7) WQB0BY59
  65.    Device 16                                  : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:8) WQB0AW76
  66.    Device 17                                  : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:9) VB00EL3F
  67. Command completed successfully.
复制代码
关键信息是这两行:
  1.    Caching                                    : Disabled
复制代码
在 arcconf 设置 磁盘组的 Caching 为 WB 模式:
  1. arcconf SETCACHE 1 LOGICALDRIVE 0 con
  2. arcconf SETCACHE 1 LOGICALDRIVE 1 con
复制代码
再次查询,已经强行改成了 缓存模式:
  1. Caching                                    : Enabled
复制代码
再次测试磁盘的IO性能:
  1. ./testdd.sh /u01 /u02 > testdd.log.`date +%Y%m%d%H%M` 2>&1 &
  2. vgraid10_local-lv01  7.3T  100G  7.2T   2% /u01 --- direct写入:38.3 MB/s direct读取:400 MB/s  cache写入:303 MB/s  cache读取:526 MB/s
  3. vgraid5_local-lv01    11T   88G   11T   1% /u02 --- direct写入:7.1 MB/s  direct读取:357 MB/s  cache写入:33.7 MB/s cache读取:350 MB/s
复制代码
结论:

打开RAID卡缓存后,raid5的 direct写入 性能仍然很差【7.1 MB/s】,但是 direct读取 性能有了大幅度提升!【128 MB/s ---> 357 MB/s】读取性能飙升而写入性能依旧拉胯,完全符合理论预期。
最后修改回原来设置:

因为 raid 卡无后备电池保护,存在丢数据风险。
  1. arcconf SETCACHE 1 LOGICALDRIVE 0 coff
  2. arcconf SETCACHE 1 LOGICALDRIVE 1 coff
复制代码
来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

相关推荐

您需要登录后才可以回帖 登录 | 立即注册