6

Linux下用dd命令测试硬盘的读写速度

 3 years ago
source link: https://zhang.ge/4172.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Jager · 7月24日 · 2014年Linux查看磁盘读写 · Linux系统dd命令 861次已读

这也是一个老方法了,只是今天用到了,就过来记录下。总觉得公司服务器磁盘不给力,有时候vim编辑的时候都会卡顿,IO经常90%+,很纳闷,就测试了一下磁盘的读写速度。

一、测试写速度:

time dd if=/dev/zero of=/tmp/test bs=8k count=1000000

测试结果:565 MB/s

二、测试读速度:

time dd if=/tmp/test of=/dev/null bs=8k

测试结果:4.7GB/s

三、测试读写速度:

time dd if=/tmp/test of=/var/test bs=64k

测试结果:387MB/s

四、参数说明

①、time有计时作用,dd用于复制,从if读出,写到of;

②、if=/dev/zero不产生IO,因此可以用来测试纯写速度;

③、同理of=/dev/null不产生IO,可以用来测试纯读速度;

④、将/tmp/test拷贝到/var则同时测试了读写速度;

⑤、bs是每次读或写的大小,即一个块的大小,count是读写块的数量。

从结果看出,俺公司的服务器磁盘读写速度还真不算慢,看来得从其他方面检测了,革命尚未成功,苦逼仍需努力。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK