public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* TCP Zero Copy for mmapped files
@ 2003-01-03 23:34 A.D.F.
  2003-01-04  0:41 ` J.A. Magallon
  0 siblings, 1 reply; 4+ messages in thread
From: A.D.F. @ 2003-01-03 23:34 UTC (permalink / raw)
  To: linux-kernel

FreeBSD 5.0 should already have a zero copy for mmapped files and
IMHO it would be worth to have it in Linux 2.6 too.

It would also be very nice to be able to enable zero copy for mmapped files
by a config option.

Many applications use mapped memory to serve lots of small and
medium sized files (4 - 1024 KB) or even a few big files
(think at web servers, i.e. Apache 2, etc.);  this is done to better
serve multiple / parallel downloads being done on the same files.

Using or not using mmap() is a userland / application choice that depends
on lots of factors / strategies that are outside kernel scope.

Besides this there seems to be some work in progress to speed up
mmap() calls, thus why not doing all the work right ?

-- 
Nick Name:      A.D.F.
E-Mail:         adefacc@tin.it
E-Mail-Font:    Courier New (plain text, no html)
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TCP Zero Copy for mmapped files
  2003-01-03 23:34 TCP Zero Copy for mmapped files A.D.F.
@ 2003-01-04  0:41 ` J.A. Magallon
  2003-01-04  1:53   ` dean gaudet
  2003-01-04 13:10   ` A.D.F.
  0 siblings, 2 replies; 4+ messages in thread
From: J.A. Magallon @ 2003-01-04  0:41 UTC (permalink / raw)
  To: linux-kernel


On 2003.01.04 A.D.F. wrote:
> FreeBSD 5.0 should already have a zero copy for mmapped files and
> IMHO it would be worth to have it in Linux 2.6 too.
> 
> It would also be very nice to be able to enable zero copy for mmapped files
> by a config option.
> 
> Many applications use mapped memory to serve lots of small and
> medium sized files (4 - 1024 KB) or even a few big files
> (think at web servers, i.e. Apache 2, etc.);  this is done to better
> serve multiple / parallel downloads being done on the same files.
> 

Apache2 uses mmap() to open files ??
So then there is a reason to include it in my patchset...

-- 
J.A. Magallon <jamagallon@able.es>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.1 (Cooker) for i586
Linux 2.4.21-pre2-jam2 (gcc 3.2.1 (Mandrake Linux 9.1 3.2.1-2mdk))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TCP Zero Copy for mmapped files
  2003-01-04  0:41 ` J.A. Magallon
@ 2003-01-04  1:53   ` dean gaudet
  2003-01-04 13:10   ` A.D.F.
  1 sibling, 0 replies; 4+ messages in thread
From: dean gaudet @ 2003-01-04  1:53 UTC (permalink / raw)
  To: J.A. Magallon; +Cc: linux-kernel

On Sat, 4 Jan 2003, J.A. Magallon wrote:

> Apache2 uses mmap() to open files ??
> So then there is a reason to include it in my patchset...

apache2.x uses sendfile.  see the apr library (where you can find sendfile
code for linux, freebsd, hpux, aix, mvs, solaris, and windoze...).  it
might also use mmap in some situations, most likely inherited from 1.x
(which uses only mmap).

-dean

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TCP Zero Copy for mmapped files
  2003-01-04  0:41 ` J.A. Magallon
  2003-01-04  1:53   ` dean gaudet
@ 2003-01-04 13:10   ` A.D.F.
  1 sibling, 0 replies; 4+ messages in thread
From: A.D.F. @ 2003-01-04 13:10 UTC (permalink / raw)
  To: J.A. Magallon; +Cc: linux-kernel

"J.A. Magallon" wrote:
> 
> On 2003.01.04 A.D.F. wrote:
> > FreeBSD 5.0 should already have a zero copy for mmapped files and
> > IMHO it would be worth to have it in Linux 2.6 too.
> >
> > It would also be very nice to be able to enable zero copy for mmapped files
> > by a config option.
> >
> > Many applications use mapped memory to serve lots of small and
> > medium sized files (4 - 1024 KB) or even a few big files
> > (think at web servers, i.e. Apache 2, etc.);  this is done to better
> > serve multiple / parallel downloads being done on the same files.
> >
> 
> Apache2 uses mmap() to open files ??

No, you cannot use mmap() to open files ... :-),
at most mmap() helps caching static file contents in order
to avoid too many open() / close() calls (which maybe slow).

Apache 2 seems to use sendfile (in blocking mode) by default,
it uses mmap() only if you enable it (see also mod_file_cache).

Other web servers (i.e. Zeus) use widely mmap() for specific
file sizes, when it is usually a strong win (specially under *BSD and
Solaris)
in big / busy servers with lots of RAM.

> So then there is a reason to include it in my patchset...

Certainly yes (after required bug fixes :-)

-- 
Nick Name:      A.D.F.
E-Mail:         adefacc@tin.it
E-Mail-Font:    Courier New (plain text, no html)
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-04 12:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-03 23:34 TCP Zero Copy for mmapped files A.D.F.
2003-01-04  0:41 ` J.A. Magallon
2003-01-04  1:53   ` dean gaudet
2003-01-04 13:10   ` A.D.F.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox