Disk Throughput - new file vs. existing file using dd

dd, disk, hard-drive, linux, shell

Solution

In order to minimize disk caching, you need to copy an amount significantly larger than the amount of memory in your system. 2X the amount of RAM in your server is a useful amount.

from http://www.westnet.com/~gsmith/content/postgresql/pg-disktesting.htm

Problem

I wanted to measure my disk throughput using the following command: ``` dd if=/dev/zero of=/mydir/junkfile bs=4k count=125000 ``` If the junkfile exists, my disk throughput is 6 times smaller than if junkfile does not exist. I have repeated that many times and the results hold. Anybody knows why? Thanks, Amir.

Original source