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 1997/07/10 01:33:08 UTC

Re: ideas for even faster serving

Yeah his response is in a thread where I mentioned trying to come up with
a solution like this which dynamically adapts the mmap cache to satisfy
the current load.  I've been trying to figure out how to get an mmap cache
that all children can share, so that hit ratios go up.

The best solution I've come up with so far is to have a pipe back to the
parent which the children send a small percentage of their file requests
up.  The parent notes these, and every 5 or 10 minutes recalculates what
to cache.  Then it opens/mmaps all in the cache, and graceful restarts the
children. 

Or multithread the server ;) 

Some sites would win with a mod_static_mmap.c that implemented this below. 
It wouldn't be quite as low as 20 system calls, because of directory_walk
and get_path_info, but it'd be a good start.

Dean

On Wed, 9 Jul 1997, Brian Behlendorf wrote:

> 
> Comments?
> 
> >X-Authentication-Warning: ficus.cnidr.org: jem owned process doing -bs
> >Date: Wed, 9 Jul 1997 00:09:45 -0400 (EDT)
> >From: Jonathan Magid <je...@cnidr.org>
> >X-Sender: jem@ficus
> >To: groovi-internet@netcom.com
> >Subject: Re: InfoWorld web server shootout (fwd)
> >
> >
> >
> >Wow. This is a very cool idea for an ultrafast web server. Does anyway see
> >any flaws with it? I mean you'd need as much VM as you have web files in
> >space, but you also have the added advantage that the VM system would
> >automatically act like a cache manager in a traditional web server-
> >keeping frequently accessed pages in core, while others are left on disk.
> >
> >Also, I guess you'd need twice as much file system disk space, to create
> >the index file, along with storing the original files. Including the
> >disk for swap space, such a server would require at least 3 times as much
> >disk as you have files, and a bunch of core to boot. 
> >
> >Worth it?
> >
> >
> >Btw, this is Alan Cox, the main author of Linux's
> >TCP/IP stack..
> >
> >
> >
> >cheers,
> >jem.
> >
> >---------- Forwarded message ----------
> >Date: Tue, 8 Jul 1997 21:55:57 +0100 (BST)
> >From: Alan Cox <al...@lxorguk.ukuu.org.uk>
> >To: Dean Gaudet <dg...@arctic.org>
> >Cc: mbeattie@sable.ox.ac.uk, linux-kernel@vger.rutgers.edu
> >Subject: Re: InfoWorld web server shootout
> >
> >> It would be easy to make a mod_mmap which has a */* handler.  If someone
> >> has the time/inclination to do so I'd love to see it.  I've got way too
> >> much on my List right now though. 
> >
> >In terms of a pure speed web server for static data (where mmap is a big win)
> >the right way[TM] is probably to preindex all the files you can serve and
> >to mmap the lot into memory at setup time with a one page gap between them
> >that contains precomputed HTML headers for each page. You then build an
> >index of the pointers to each URL, feed all the URL's through the GNU
> >perfect hash program to generate a hash and each web page serve becomes
> >
> >	x=unhash(url)
> >	if(x==NULL)
> >		x=NOT_FOUND_ENTRY;
> >	write(socket, x->data,x->len)
> >	close(socket);
> >
> >if you want to play total speed then someone should write a web server that
> >does this and uses clone() to create all of its threads. I suspect you can
> >probably serve a web page in about 20 syscalls, less if the headers arrive
> >in one chunk from the client.
> >
> >Now that would be THE web server of choice for porn sites 8)
> >
> >Alan
> >
> >
> >
> --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
> "Why not?" - TL           brian@organic.com - hyperreal.org - apache.org
>