写入速度测试
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