httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Tatarinov <>
Subject Re: Want to add file caching to Apache
Date Fri, 21 Nov 1997 02:55:44 GMT
Brian Behlendorf wrote:
> >From a contact at Microsoft:
> >If you do add file caching to apache, make sure to leave a way not to do
> >this on NT.  File caching comes for free when you use the Win32 functions
> >like TransmitFile, etc that we have talked about using for Apache 2.0.  To
> >manage the file cache you setup a file handle cache, closing file handles
> >when you do not need the file in cache and keeping open the ones you do want
> >in cache.  Implementing a separate file cache would move the file cache out
> >of the kernel into user space and would force copies of the file date, which
> >is very CPU expensive...

I would say there is nothing different from UNIX here (I confess, I have 
no idea about NT internals). I mean, if a lot of files have to go thru
the cache only to be replaced a second later (low hit rate, high load),
the cache will slow the system down.

BUT as I said, I use 80% as a base hit rate figure. In this case, a 
cache should help. Another thing is, even with a low hit ratio, we can 
avoid cache overhead if we admit files in a smart way (not like 
LRU+threshold does which only considers file size). In this case, 
the number of replacements will be relatively low. Besides, there 
is static caching that doesn't have any CPU overhead 99.99% of time.

> >The implementation below is sometimes called file shadowing, Netscape
> >implements it (I think).  What we have seen is that this adds about 5%
> >performance increase when all data can fit into RAM, and about a 40%
> >performance penalty (at least on NT, don't know about other OSes) when there
> >is more active data than RAM, because it requires extra file copies, etc.

I would guess that these figures do not reflect I/O savings which are
harder to measure. As for the penalty, see what I've said above.

I am planning to do a lot of performance testing of whatever I'll write
using real traces (and dummy files). Hope it will help.

Igor Tatarinov, graduate student, Computer Science Dept, NDSU
e-mail:   or

View raw message