Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 27301 invoked by uid 6000); 21 Nov 1997 02:52:54 -0000 Received: (qmail 27295 invoked from network); 21 Nov 1997 02:52:53 -0000 Received: from prairie.nodak.edu (root@134.129.111.80) by taz.hyperreal.org with SMTP; 21 Nov 1997 02:52:53 -0000 Received: from prairie.nodak.edu (junker.cs.ndsu.NoDak.edu [134.129.125.144]) by prairie.NoDak.edu (8.8.8/8.8.8) with ESMTP id UAA07546 for ; Thu, 20 Nov 1997 20:52:50 -0600 (CST) Message-ID: <3474F830.54AFF43A@prairie.nodak.edu> Date: Thu, 20 Nov 1997 20:55:44 -0600 From: Igor Tatarinov X-Mailer: Mozilla 4.03 [en] (WinNT; I) MIME-Version: 1.0 To: new-httpd@apache.org Subject: Re: Want to add file caching to Apache References: <3.0.3.32.19971120182715.009a8380@localhost> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Igor Tatarinov, graduate student, Computer Science Dept, NDSU e-mail: tatarino@prairie.nodak.edu or itat@acm.org http://www.cs.ndsu.nodak.edu/~tatarino ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~