【发布时间】:2011-01-12 02:35:48
【问题描述】:
我在 Linux Fedora Core 11 机器上看到了一些 PHP 脚本的性能问题,因此我运行了一些命令来寻找瓶颈。我注意到的一件事是编写文件非常快:
[root@localhost ~]# dd if=/dev/zero of=/root/myGfile bs=1024K count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 1.0817 s, 969 MB/s
但是覆盖它需要更长的时间;
[root@localhost ~]# dd if=/dev/zero of=/root/myGfile bs=1024K count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 23.0658 s, 45.5 MB/s
这是为什么呢? (我可以重复这些结果。)
【问题讨论】:
-
你可以尝试在命令之间运行
sync,看看有什么不同吗?
标签: linux performance io disk ext3