Re: Kernel VS application file caching

On Fri, Jan 22, 2010 at 01:37:53PM +0100, Martin Husemann wrote:
> On Fri, Jan 22, 2010 at 12:29:31PM +0000, Sad Clouds wrote:
> > So far the closet that comes to it is calling open() with O_DIRECT flag.
>
> Have you looked at bozohttpd's mmap_and_write_part() function?
> You can find it in src/libexec/httpd/bozohttpd.c.
>
> If not using https, this is quite efficient for a service sending raw
> file content out to a socket.
Or nginx, which is a bit larger, but non-forking. It also allows a lot
of flexibility. A strong recommendation is to not reinvent the wheel
here.
Joerg