Subject: Re: RAW access to files
To: Arne H Juul <Arne.Juul@osl.fast.no>
From: Alfred Perlstein <bright@mu.org>
List: tech-kern
Date: 12/11/2001 19:23:17
* Arne H Juul <Arne.Juul@osl.fast.no> [011211 17:55] wrote:
> On Tue, 11 Dec 2001, Ignatios Souvatzis wrote:
> > On Mon, Dec 10, 2001 at 07:42:07PM +0100, Wojciech Puchar wrote:
> > > > this is more often called "direct i/o" or "unbuffered i/o".
> > > > it's on the list of things I want to add, but I haven't had time yet.
> > >
> > > it would be really good! with support in common mpeg/divx players etc..
> > > and with option in cp and dd
> >
> > Why do you think that "raw" I/O would be more efficient than the filesystem
> > + buffer cache doing readahead?
>
> Because that's what benchmarks and real production use of some
> applications with and without direct io show :-) I don't think
> "cp" is such a good example though, since you lose the readahead.
> For some (typically database-like) apps it can be a pretty big boost.
>
> Disclaimer: We've actually *measured* the performance difference
> for our app only on FreeBSD, Windows, Solaris, and Linux, AFAIK.
Direct IO is a good idea, it prevents applications that are basically
doing a cache walk from blowing out all your cache.
Take for instance anything that either keeps its own cache (postgresql)
or something that would completely never reuse its cache, like
cp/dd.
If you want to check out performance of your app on FreeBSD give the
open(2) syscall a flag of O_DIRECT and let me know how it changes
your numbers. :)
--
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'
http://www.morons.org/rants/gpl-harmful.php3