linux读写测试

写入速度测试

dd if=/dev/zero of=test_file bs=1G count=1 oflag=direct

这个命令会创建一个1GB的文件,并直接写入到磁盘上(oflag=direct 确保绕过文件系统缓存)。

华为云2核2G测试

# dd if=/dev/zero of=test_file bs=1G count=1 oflag=direct

1+0 records in 

1+0 records out 

1073741824 bytes (1.1 GB, 1.0 GiB) copied, 25.4927 s, 42.1 MB/s

读取速度测试

dd if=test_file of=/dev/null bs=1G count=1 iflag=direct

这个命令会读取之前创建的1GB文件,并直接从磁盘读取(iflag=direct 确保绕过文件系统缓存)。

华为云2核2G测试
# dd if=test_file of=/dev/null bs=1G count=1 iflag=direct
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 8.54822 s, 126 MB/s

赞(0)
未经允许不得转载:程序员中文网 » linux读写测试
关于我们 免责申明 意见反馈 隐私政策
程序员中文网:公益在线网站,帮助学习者快速成长!
关注微信 技术交流
推荐文章
每天精选资源文章推送
推荐文章
随时随地碎片化学习
推荐文章
发现有趣的