dd命令测试硬盘IO

时间:2023-03-09 09:20:46
dd命令测试硬盘IO
1.用Linux自带的命令dd测试硬盘IO,如下
------------------------------------
写:
[root@server102 ~]# time dd if=/dev/zero bs= count= of=/tmp/1Gb.file
+ records in
+ records out
bytes (1.0 GB) copied, 2.28729 s, 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
+ records in
+ records out
bytes (1.0 GB) copied, 1.27014 s, MB/s
+ records in
+ records out
bytes (1.0 GB) copied, 1.27062 s, 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: MB in 2.00 seconds = 7935.60 MB/sec
Timing buffered disk reads: MB in 3.01 seconds = 483.98 MB/sec