linux下测试硬盘读写速度


买了个ssd硬盘,就想着跟普通的机械盘做个比较,因为桌面装的是ubuntu系统,所以就想用linux的命令简单测一下好了

下面是ssd的性能数据:

测试写:

xxx@WaitFish:~ > time dd if=/dev/zero bs=1024 count=1000000 of=1Gb.file
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 3.78724 s, 270 MB/s

real    0m3.789s
user    0m0.839s
sys     0m2.527s

从null读数据到文件,块大小1024 数量1000000

测试读:

xxx@WaitFish:~ >time dd of=1Gb.file if=/dev/zero bs=1024 count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 3.84934 s, 266 MB/s

real    0m4.009s
user    0m0.852s
sys     0m2.698s
从文件读数据到null,测试读性能

下面是机械盘的速度:

写性能:

sudo time dd if=/dev/zero bs=1024 count=1000000 of=1Gb.file
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 69.5384 s, 14.7 MB/s
1.62user 13.84system 1:09.56elapsed 22%CPU (0avgtext+0avgdata 704maxresident)k
72inputs+0outputs (2major+221minor)pagefaults 0swaps
读性能: 
xxx@WaitFish:/media/xx/新加卷 > sudo time dd of=1Gb.file if=/dev/zero bs=1024 count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 71.2378 s, 14.4 MB/s
1.66user 14.34system 1:11.34elapsed 22%CPU (0avgtext+0avgdata 700maxresident)k
0inputs+0outputs (0major+224minor)pagefaults 0swaps
看来差的还不是一点点啊,哈哈哈

相关内容