RAID10和RAID5性能对比测试

简介: 本文通过实测对比4盘RAID5与RAID10在无缓存(Write Through)下的IO性能:RAID10直接写入达38.7MB/s,远超RAID5的7.4MB/s;启用缓存后RAID5读性能显著提升(128→357MB/s),但写性能仍极低。结论:无BBU保护时,RAID10更安全高效。(239字)

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

一、raid无缓存

3个文件系统:

---u01: hdd 4T*4 raid10,raid无缓存
---u02: hdd 4T*4 raid5,raid无缓存
---u03: ssd 447G*1

测试结果如下:

./testdd.sh /u01 /u02 /u03 > testdd.log.`date +%Y%m%d%H%M` 2>&1 &
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
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
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 是无缓存模式:

[root@host2 ~]# lsblk
NAME                   MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdc                      8:32   0   7.3T  0 disk  
└─vgraid10_local-lv01  253:3    0   7.3T  0 lvm   /u01
sdd                      8:48   0  10.9T  0 disk  
└─vgraid5_local-lv01   253:4    0  10.9T  0 lvm   /u02
sdb                      8:16   0 447.1G  0 disk  
└─vgssd_local-lv01     253:5    0   447G  0 lvm   /u03

执行 arcconf getconfig 1 ld 显示 Logical Device number 0 和 1 的配置信息:

[root@host2 ~]# arcconf getconfig 1 ld
Controllers found: 1
--------------------------------------------------------
Logical device information
--------------------------------------------------------
Logical Device number 0
   Logical Device name                        : vd1
   Disk Name                                  : /dev/sdc (Disk0) (Bus: 1, Target: 0, Lun: 0)
   Block Size of member drives                : 512 Bytes
   Array                                      : 0
   RAID level                                 : 10
   Status of Logical Device                   : Optimal
   Size                                       : 7630830 MB
   Stripe-unit size                           : 256 KB
   Full Stripe Size                           : 512 KB
   Interface Type                             : Serial ATA
   Device Type                                : Data
   Boot Type                                  : None
   Heads                                      : 255
   Sectors Per Track                          : 32
   Cylinders                                  : 65535
   Caching                                    : Disabled
   Mount Points                               : Not Mounted
   LD Acceleration Method                     : None
   SED Encryption                             : Disabled
   Volume Unique Identifier                   : 600508B1001CF6173057FB8A85255004
--------------------------------------------------------
   Logical Device segment information
--------------------------------------------------------
   Segment                                    : Availability (SizeMB, Protocol, Type, Connector ID, Location) Serial Number
--------------------------------------------------------
   Group 0, Segment 0                         : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:2) WQB0BYF0
   Group 0, Segment 1                         : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:4) WQB0B5PV
   Group 1, Segment 0                         : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:3) WQB0B5V7
   Group 1, Segment 1                         : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:5) V302WXYF

Logical Device number 1
   Logical Device name                        : vd2
   Disk Name                                  : /dev/sdd (Disk0) (Bus: 1, Target: 0, Lun: 1)
   Block Size of member drives                : 512 Bytes
   Array                                      : 1
   RAID level                                 : 5
   Status of Logical Device                   : Optimal
   Parity Initialization Status               : Completed
   Size                                       : 11446245 MB
   Stripe-unit size                           : 256 KB
   Full Stripe Size                           : 768 KB
   Interface Type                             : Serial ATA
   Device Type                                : Data
   Boot Type                                  : None
   Heads                                      : 255
   Sectors Per Track                          : 32
   Cylinders                                  : 65535
   Caching                                    : Disabled
   Mount Points                               : Not Mounted
   LD Acceleration Method                     : None
   SED Encryption                             : Disabled
   Volume Unique Identifier                   : 600508B1001CE4C11BEB914107DF0141
--------------------------------------------------------
   Array Physical Device Information
--------------------------------------------------------
   Device ID                                  : Availability (SizeMB, Protocol, Type, Connector ID, Location) Serial Number
--------------------------------------------------------
   Device 14                                  : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:6) V3039ZHF
   Device 15                                  : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:7) WQB0BY59
   Device 16                                  : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:8) WQB0AW76
   Device 17                                  : Present (3815447MB, SATA, HDD, Connector:CN0, Enclosure:1, Slot:9) VB00EL3F

Command completed successfully.

关键信息是这两行:

   Caching                                    : Disabled

在 arcconf 设置 磁盘组的 Caching 为 WB 模式:

arcconf SETCACHE 1 LOGICALDRIVE 0 con
arcconf SETCACHE 1 LOGICALDRIVE 1 con

再次查询,已经强行改成了 缓存模式:

Caching                                    : Enabled

再次测试磁盘的IO性能:

./testdd.sh /u01 /u02 > testdd.log.`date +%Y%m%d%H%M` 2>&1 &
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
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 卡无后备电池保护,存在丢数据风险。

arcconf SETCACHE 1 LOGICALDRIVE 0 coff
arcconf SETCACHE 1 LOGICALDRIVE 1 coff

三、测试脚本

vim testdd.sh
#!/bin/bash
if [ $# -lt 1 ]; then
  echo "usage: $0 /target1 /target2 /target3 ..."
  exit 1
fi

while [ $# -gt 0 ]; do
  target=$1
  echo "${target} direct写入:"
  sync && echo 3 > /proc/sys/vm/drop_caches
  time dd if=/dev/zero of=${target}/dd.out bs=8k count=200000 oflag=direct
  echo "${target} direct读取:"
  sync && echo 3 > /proc/sys/vm/drop_caches
  time dd if=${target}/dd.out of=/dev/null bs=8k count=200000 iflag=direct
  echo "${target} cache写入:"
  sync && echo 3 > /proc/sys/vm/drop_caches
  time dd if=/dev/zero of=${target}/dd.out bs=8k count=200000
  echo "${target} cache读取:"
  sync && echo 3 > /proc/sys/vm/drop_caches
  time dd if=${target}/dd.out of=/dev/null bs=8k count=200000
  shift
done

chmod +x testdd.sh
./testdd.sh /u01 /u02 > testdd.log.`date +%Y%m%d%H%M` 2>&1 &
目录
相关文章
|
Java Linux 数据安全/隐私保护
华为云计算FusionCompute虚拟化平台的安装与设置
华为云计算FusionCompute虚拟化平台的安装与设置
1743 0
华为云计算FusionCompute虚拟化平台的安装与设置
|
4月前
|
存储 数据采集 安全
微调与安全隐私 —— 大模型落地的合规必修课
本文聚焦大模型微调中的安全与隐私合规风险,系统剖析数据集、训练、输出三大环节的典型隐患(如敏感信息泄露、版权侵权、模型反演等),提出“脱敏+加密+过滤”全流程防护方案,并推荐合规认证平台与实操工具,助力企业实现技术落地与法律合规双保障。(239字)
|
5月前
|
存储 弹性计算 人工智能
2026年阿里云免费试用说明:云服务器等云产品领取指南
阿里云长期推出免费云产品试用体系,覆盖从基础算力到创新工具的全场景需求,为个人开发者、学生及初创企业降低了上云门槛。但免费资源背后存在配置限制、合规要求等细节问题,需结合自身场景理性选择。以下从资源矩阵、使用体验、避坑技巧及适用场景四方面,用通俗语言详细解析,帮助高效利用免费资源。
1346 3
|
监控 Linux 调度
Veeam ONE 13 之初见 - Web 控制台和 Veeam 监控的未来
Veeam ONE 13 之初见 - Web 控制台和 Veeam 监控的未来
317 1
Veeam ONE 13 之初见 - Web 控制台和 Veeam 监控的未来
|
存储 固态存储 数据库
|
存储 算法 安全
FreeMQTT:一款Python语言实现的开源MQTT Server
FreeMQTT 是一款用 Python 语言并基于 Tornado 开发的开源 MQTT 服务器,支持 MQTT3.1.1 和 MQTT5.0 协议,提供多租户安全隔离、高效 Topic 匹配算法及实时上下线通知等功能,适用于 IoT 场景。快速启动仅需克隆仓库、安装依赖并运行服务。
1957 0
|
11月前
|
监控 数据安全/隐私保护 Windows
Veeam Data Platform 12.3.2 (Windows) - 数据保护和管理解决方案
Veeam Data Platform 12.3.2 (Windows) - 数据保护和管理解决方案
221 1
|
SQL 监控 安全
命令注入攻击
【8月更文挑战第17天】
1133 2
|
Ubuntu 数据安全/隐私保护
Ubuntu22.04LTS环境部署实战
这篇文章提供了Ubuntu 22.04 LTS操作系统的详细安装步骤,包括选择语言、键盘布局、网络配置、软件源设置、磁盘分区、安装OpenSSH服务以及完成安装和首次登录系统的过程。
9481 6
Ubuntu22.04LTS环境部署实战