说明:
我们有一个服务器:
- 型号:HP ProLiant DL160 G6
- 4个240GB SSD(RAID-10)
- 72GB DDR3内存
- 2个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
命令仍然显示:
定时缓冲磁盘读取:3.00秒内810 MB = 269.85 MB /秒
更新2(已调整实用程序包)-读取速度现在为600MB / s:
终于有了希望,我们从raid控制器中禁用了缓存,并且较早地做了一些其他事情,但是没有运气,但是由于我们重新加载了服务器并再次安装了操作系统,因此我们忘记安装ewwhite的答案中建议的“ tuned-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
即使使用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
iozone -t1 -i0 -i1 -i2 -r1m -s144g
。:(