使用dd命令进行磁盘IO性能测试

作者:焦振清
时间:2018-08-10


Each FLAG symbol may be:

  • append append mode (makes sense only for output; conv=notrunc suggested)
  • direct use direct I/O for data
  • directory fail unless a directory
  • dsync use synchronized I/O for data
  • sync likewise, but also for metadata
  • nonblock use non-blocking I/O
  • noatime do not update access time
  • nocache discard cached data
  • noctty do not assign controlling terminal from file
  • nofollow do not follow symlinks
  • seek_bytes treat ‘seek=N’ as a byte count (oflag only)
11GB写入平均速度11GB写入耗时
oflag=dsync23.8 MB/s451.175 s
oflag=sync23.9 MB/s449.224 s
oflag=noctty205 MB/s52.2653 s
oflag=direct228 MB/s47.1613 s
oflag=nocache1.8 GB/s6.06891 s
无参数2.0 GB/s5.31452 s
oflag=nonblock2.1 GB/s5.18157 s
oflag=noatime2.0 GB/s5.25155 s

第一种场景:无参数

  • dd if=/dev/zero of=./test.iso bs=1M count=10240
  • 10240+0 records in
  • 10240+0 records out
  • 10737418240 bytes (11 GB) copied, 5.31452 s, 2.0 GB/s

第二种场景:oflag=direct

  • dd if=/dev/zero of=./test.iso bs=1M count=10240 oflag=direct
  • 10240+0 records in
  • 10240+0 records out
  • 10737418240 bytes (11 GB) copied, 47.1613 s, 228 MB/s

第三种场景:oflag=dsync

  • dd if=/dev/zero of=./test.iso bs=1M count=10240 oflag=dsync
  • 10240+0 records in
  • 10240+0 records out
  • 10737418240 bytes (11 GB) copied, 451.175 s, 23.8 MB/s

第四种场景:oflag=sync

  • dd if=/dev/zero of=./test.iso bs=1M count=10240 oflag=sync
  • 10240+0 records in
  • 10240+0 records out
  • 10737418240 bytes (11 GB) copied, 449.224 s, 23.9 MB/s

第五种场景:oflag=nonblock

  • dd if=/dev/zero of=./test.iso bs=1M count=10240 oflag=nonblock
  • 10240+0 records in
  • 10240+0 records out
  • 10737418240 bytes (11 GB) copied, 5.18157 s, 2.1 GB/s

第六种场景:oflag=noatime

  • dd if=/dev/zero of=./test.iso bs=1M count=10240 oflag=noatime
  • 10240+0 records in
  • 10240+0 records out
  • 10737418240 bytes (11 GB) copied, 5.25155 s, 2.0 GB/s

第七种场景:oflag=nocache

  • dd if=/dev/zero of=./test.iso bs=1M count=10240 oflag=nocache
  • 10240+0 records in
  • 10240+0 records out
  • 10737418240 bytes (11 GB) copied, 6.04308 s, 1.8 GB/s

第八种场景:oflag=noctty

  • dd if=/dev/zero of=./test.iso bs=1M count=10240 oflag=noctty
  • 10240+0 records in
  • 10240+0 records out
  • 10737418240 bytes (11 GB) copied, 52.3026 s, 205 MB/s

参考文章:

Linux中直接I/O机制的介绍

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值