View Single Post
  #3  
Old August 8th 09, 01:25 AM posted to comp.os.linux.development.system,comp.arch.storage
David Schwartz
external usenet poster
 
Posts: 5
Default Writing to block device is *slower* than writing to thefilesystem!?

On Aug 7, 5:30*am, kkkk wrote:

If I create an xfs filesystem on it (whole device, no partitioning,
aligned stripes during mkfs, etc) then I write to a file with dd (or
with bonnie++) like this:
* sync ; echo 3 /proc/sys/vm/drop_caches ; dd if=/dev/zero
of=/mnt/tmp/ddtry bs=1M count=6000 conv=fsync ; time sync
about 540MB/sec come out (last sync takes 0 seconds). This is similar to
3ware-declared performances of 561MB/sec
*http://www.3ware.com/KB/Article.aspx?id=15300

however, if instead I write directly to the block device like this
* sync ; echo 3 /proc/sys/vm/drop_caches ; dd if=/dev/zero of=/dev/sdc
bs=1M count=6000 conv=fsync ; time sync
performance is 260MB/sec!?!? (last sync takes 0 seconds)

I tried many times and this is the absolute fastest I could obtain. I
tweaked the bs, the count, I removed the conv=fsync... i ensured 3ware
caches are ON on the block device, I set anticipatory scheduler... No
way. I am positive that creating the xfs filesystem and writing on it is
definitely faster than writing to the block device directly.

How could that be!? Anyone knows what's happening?


There could be a lot of reasons, but the most likely is that they're
writing to opposite ends of the drive. To test, put a 'skip' in your
'dd' to the block device. See if larger skips result in higher speeds.

DS