You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1998/03/06 10:56:46 UTC

Re: mmap() versus read() (fwd)

sigh. 

Everything runs on linux 2.0.x really well until you get a working set
larger than RAM.  Then you do far too much i/o... more than you would if
you were using read() instead of mmap().

(Which exactly describes twinlark.arctic.org this week because of a .mov
mirror that's just larger than RAM.) 

Dean

---------- Forwarded message ----------
From: Alan Cox <al...@lxorguk.ukuu.org.uk>
Subject: Re: mmap() versus read()
To: Dean Gaudet <dg...@arctic.org>
Date: Fri, 6 Mar 1998 08:52:56 +0000 (GMT)
Cc: linux-kernel@vger.rutgers.edu

> So is this expected?  Is there a knob I can twist?  Is this just 2.0.32
> buffer problems and would be fixed by 2.0.33?

mmap doesnt do readahead on faults in 2.0.x, that increases the I/O load
when paging mmap data versus read() quite a lot



Re: mmap() versus read() (fwd)

Posted by Dean Gaudet <dg...@arctic.org>.

On Fri, 6 Mar 1998, Igor Tatarinov wrote:

> How come then that "The Linux Kernel" by David Rusling 
> (http://sunsite.unc.edu/LDP/LDP/tlk/tlk.html, chapter 4.7) 
> says that Linux always prefetches the following page on a page fault? 
> (as does Solaris) 

I wouldn't be surprised if the book is wrong. 

> If it does prefetch another page then it reads 8K at once. Apache's
> IOBUFSIZE is also 8K so there should be no difference !?
> Unless, the prefetch is issued as a separate I/O ?

The difference is that read() readahead is like 16k or 32k.

Dean


Re: mmap() versus read() (fwd)

Posted by Igor Tatarinov <ta...@prairie.NoDak.edu>.
> 
> ---------- Forwarded message ----------
> From: Alan Cox <al...@lxorguk.ukuu.org.uk>
> Subject: Re: mmap() versus read()
> To: Dean Gaudet <dg...@arctic.org>
> Date: Fri, 6 Mar 1998 08:52:56 +0000 (GMT)
> Cc: linux-kernel@vger.rutgers.edu
> 
> > So is this expected?  Is there a knob I can twist?  Is this just 2.0.32
> > buffer problems and would be fixed by 2.0.33?
> 
> mmap doesnt do readahead on faults in 2.0.x, that increases the I/O load
> when paging mmap data versus read() quite a lot

How come then that "The Linux Kernel" by David Rusling 
(http://sunsite.unc.edu/LDP/LDP/tlk/tlk.html, chapter 4.7) 
says that Linux always prefetches the following page on a page fault? 
(as does Solaris) 

If it does prefetch another page then it reads 8K at once. Apache's
IOBUFSIZE is also 8K so there should be no difference !?
Unless, the prefetch is issued as a separate I/O ?

igor