Subject: Re: ffs and bufcache benchmarks - round two
To: Gergely EGERVARY <mauzi@expertlan.hu>
From: Chuck Silvers <chuq@chuq.com>
List: tech-perform
Date: 10/02/2001 22:14:13
hi,

ok, I tried your test series below and I see the same sort of slowdown
with smaller dd buffer sizes.  I think this is because linux does
all writes "delayed", only writing data to disk once a bunch of data
has been written to the kernel.  whereas NetBSD tries to write the
buffered data to disk sooner, currently after 64k has been transferred
into the kernel's cache.  if this is the same 256MB machine you described
before, then the test data fits entirely in memory, so linux is effectively
using a 64MB buffer size no matter what buffer size dd is using.

I checked in a change to NetBSD just now that makes "async" mounts
work like they traditionally did in unix, which is how ext2 mounts
work by default in linux.  if you update your kernel to include
rev. 1.36 of ufs_readwrite.c and rerun your test with the filesystem
mounted with "-o async", then you should see similar results to linux.

another interesting test would be to make the test file big enough
that it doesn't fit in memory.  try a 1GB file and see what effect
the different blocksizes have on each OS then.

-Chuck


On Sun, Sep 30, 2001 at 05:35:50PM +0200, Gergely EGERVARY wrote:
> sorry for the late response - I was quite busy this week.
> 
> as you said sequential i/o will be re-blocked by the kernel to 64k chunks.
> would it be possible to dynamically resize this value by the vm?
> (alternatively, is it possible to increase this value by hand?)
> 
> some tests, as usual:
> 
> NetBSD-1.5Y, all of these are "first-run" tests. (same disk, same machine,
> same partition layout, etc.)
> 
> # time dd if=file1 of=file2 bs=64k count=1024
> 	38.60s real	0.00s user	1.36s system
> 
> # time dd if=file1 of=file2 bs=1024k count=64
> 	12.97s real	0.00s user	1.36s system
> 
> # time dd if=file1 of=file2 bs=8192k count=8
> 	11.10s real	0.00s user	1.32s system
> 
> and then the same tests on Linux 2.2.19:
> 
> # time dd if=file1 of=file2 bs=64k count=1024
> 	8.45s real	0.00s user	1.54s system
> 
> # time dd if=file1 of=file2 bs=1024k count=64
> 	8.50s real	0.00s user	1.55s system
> 
> # time dd if=file1 of=file2 bs=8192k count=8
> 	8.75s real	0.01s user	1.65s system
> 
> sorry, there are no FreeBSD test results this time due to a hardware
> failure.
> 
> --
> Gergely EGERVARY
> System Administrator
> Business Polytechnic, HUNGARY