time dd
if=/dev/zero of=/tmp/test bs=8k count=1000000
|
測試結果:565 MB/spython
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
spa
①、time有計時做用,dd用於複製,從if讀出,寫到of;3d
②、if=/dev/zero不產生IO,所以能夠用來測試純寫速度;code
③、同理of=/dev/null不產生IO,能夠用來測試純讀速度;regexp
④、將/tmp/test拷貝到/var則同時測試了讀寫速度;server
⑤、bs是每次讀或寫的大小,即一個塊的大小,count是讀寫塊的數量。blog
實例測試:it
[root@gpu-server-003 tmp]# time dd if=/dev/zero of=/mnt2/test bs=8k count=1000000 1000000+0 records in 1000000+0 records out 8192000000 bytes (8.2 GB) copied, 5.60322 s, 1.5 GB/s real 0m5.620s user 0m0.078s sys 0m5.525s [root@gpu-server-003 tmp]# [root@gpu-server-003 tmp]# time dd if=/dev/zero of=/mnt/test bs=8k count=1000000 1000000+0 records in 1000000+0 records out 8192000000 bytes (8.2 GB) copied, 6.41214 s, 1.3 GB/s real 0m6.414s user 0m0.097s sys 0m6.318s [root@gpu-server-003 tmp]# You have new mail in /var/spool/mail/root [root@gpu-server-003 tmp]# [root@gpu-server-003 tmp]# time dd if=/mnt2/test of=/dev/null bs=8k 1000000+0 records in 1000000+0 records out 8192000000 bytes (8.2 GB) copied, 1.62227 s, 5.0 GB/s real 0m1.624s user 0m0.082s sys 0m1.541s [root@gpu-server-003 tmp]# [root@gpu-server-003 tmp]# time dd if=/mnt/test of=/dev/null bs=8k 1000000+0 records in 1000000+0 records out 8192000000 bytes (8.2 GB) copied, 1.81242 s, 4.5 GB/s real 0m1.814s user 0m0.073s sys 0m1.739s