㈠ dd:从一个源读取数据然后以比特形式写到另一个目标地址
[root@ ~]# dd if=/dev/zero of=/home/Oracle/disktest bs=1M count=512 conv=fdatasync
注释
if:从哪来
of:往哪去
bs:每次读取的数据块大小
count:读多少个bs
conv:消除Linux内存缓存的影响,保证数据直接写入磁盘
测试步骤:
建议运行多次取平均值,并且每次运行前把Linux缓存清理
[root@ ~]# echo 3 > /proc/sys/vm/drop_caches
[root@ ~]# dd if=/dev/zero of=/home/oracle/disktest bs=1M count=512 conv=fdatasync
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 27.4893 seconds, 19.5 MB/s
[root@ ~]#
[root@ ~]#
[root@ ~]#
[root@ ~]# echo 3 > /proc/sys/vm/drop_caches
[root@ ~]# dd if=/dev/zero of=/home/oracle/disktest bs=1M count=512 conv=fdatasync
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 17.3697 seconds, 30.9 MB/s
[root@ ~]#
[root@ ~]#
[root@ ~]#
[root@ ~]#
[root@ ~]# echo 3 > /proc/sys/vm/drop_caches
[root@ ~]# dd if=/dev/zero of=/home/oracle/disktest bs=1M count=512 conv=fdatasync
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 14.9991 seconds, 35.8 MB/s
[root@ ~]#
[root@ ~]#
[root@ ~]#
[root@ ~]# echo 3 > /proc/sys/vm/drop_caches
[root@ ~]# dd if=/dev/zero of=/home/oracle/disktest bs=1M count=512 conv=fdatasync
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 15.2154 seconds, 35.3 MB/s
19.5 MB/s + 30.9 MB/s + 35.8 MB/s + 35.3 MB/s这几个值相加取平均
㈡ hdparm
有两个参数:
-t:磁盘性能检测
-T:内存缓存性能检测
同样建议多次测试取平均
[root@ ~]# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 226 MB in 3.02 seconds = 74.82 MB/sec
[root@ ~]# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 244 MB in 3.10 seconds = 78.59 MB/sec
[root@ ~]# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 246 MB in 3.12 seconds = 78.87 MB/sec
以上两个工具,仅仅返回的是读写性能,测试比较简单