httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: using sendfile on MMAP'd buckets
Date Sun, 09 Sep 2001 19:00:10 GMT
On Sun, 9 Sep 2001, Brian Pane wrote:

> On Linux, at least, it's a win.  I did some experiments a few weeks ago
> and found that, after doing open and mmap on a file, it's faster to send
> it with sendfile than with write.

If you are going to use sendfile(), then mmap()ing the file to begin
with is pointless and just adds overhead.  It would seem that it would be
better to delay on making a decision about if a file will be mmap()ed or
not until there is some actual need to mmap it instead of just doing it
anyway.

The tradeoffs between just opening a file and writing it, mmap()ing it,
and sendfile()ing it are somewhat complex, and difficult to test for.  
There can be a lot of issues with interactions in the VM system on systems
under a high load that can make mmap()ing be less optimal than you may
hope sometimes.


Mime
View raw message