我们有一个服务器:
>型号:HP ProLiant DL160 G6
> 4 x 240GB SSD(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
这是写速度:
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
我们希望通过raid 10获得1GB的读取速度,但270MB甚至不是单个磁盘的速度!
问题:
>为什么这么慢?
>是因为RAID控制器吗?
更新1 – 相同的读/写速度:
更改了答案中提到的一些设置后,我得到以下结果:
(任何人都知道为什么它显示4GB而不是400MB作为读取速度?!)
编辑:看起来命令是错误的,我们应该使用-s144g这个数量的ram,这就是为什么它显示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
但旧的hdparm -t / dev / sda命令仍显示:
定时缓冲磁盘读取:在300秒内810 MB = 269.85 MB /秒
更新2(tuned-utils pack) – 读取速度现在为600MB / s:
最后有些希望,我们已经从raid控制器中禁用了缓存并且之前做了一些其他事情没有运气,但是因为我们重新加载了服务器并再次安装了操作系统,我们忘记按照ewwhite的回答中的建议安装“tuned-utils”(谢谢ewwhite为你建议的这个很棒的包裹)
安装tuned-utils并选择企业存储配置文件后,读取速度现在约为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
即使使用hdparm -t / dev / sda命令,我们也有:
定时缓冲磁盘读取:在300秒内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
解决方法
>您使用消费者SATA SSDs on an HP Smart Array P410 RAID controller限制了吞吐量.在这些控制器上SATA磁盘的运行速度为3.0Gbps(3G),而不是6.0Gbps(6G).这是影响英特尔固态硬盘读取速度的障碍;每个驱动器300MB / s或更低.
> Smart Array P410控制器与SSD一起使用时具有specific requirements and best-practices.简而言之,控制器能够提供50,000 IOPS,为您的SSD容量禁用阵列加速器,性能最高可达~6个驱动器.
>磁盘性能并不总是与顺序读/写速度有关.尝试使用适当的工具(如iozone或bonnie++)进行基准测试.您仍然可以获得多个驱动器的随机I / O优势.
>在操作系统级别,安装tuned-utils软件包并将配置文件设置为企业级性能,以消除文件系统中的写入障碍,并为您的设置设置正确的I / O电梯.这也包含在other questions here中.
>看起来你正在使用LVM.这也会产生影响……
以下是在同一HP Smart Array P410 RAID控制器上运行4个consumer 6G SATA SSDs(降速至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