1.用Linux自带的命令dd测试硬盘IO,如下
------------------------------------
写:
[root@server102 ~]# time dd if=/dev/zero bs=1024 count=1000000 of=/tmp/1Gb.file 1000000+0 records in 1000000+0 records out 1024000000 bytes (1.0 GB) copied, 2.28729 s, 448 MB/s real 0m2.375s user 0m0.079s sys 0m2.028s
读:
[root@server102 ~]# time dd if=/tmp/1Gb.file bs=64k |dd of=/dev/null 15625+0 records in 15625+0 records out 1024000000 bytes (1.0 GB) copied, 1.27014 s, 806 MB/s 2000000+0 records in 2000000+0 records out 1024000000 bytes (1.0 GB) copied, 1.27062 s, 806 MB/s real 0m1.272s user 0m0.163s sys 0m1.763s
2.第二种方法
[root@dbserver01 email_info]# hdparm -Tt /dev/sda /dev/sda: Timing cached reads: 15854 MB in 2.00 seconds = 7935.60 MB/sec Timing buffered disk reads: 1456 MB in 3.01 seconds = 483.98 MB/sec