httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: cache GC check after fork patch
Date Fri, 04 Jun 1999 17:09:14 GMT


On Thu, 3 Jun 1999, Scott Hess wrote:

> While testing the graceful shutdown patch I posted yesterday, I also ran
> across this one.  The ap_proxy_garbage_coll() function in proxy_cache.c
> fork()s a child process, _then_ checks whether it's time to garbage collect.
> As far as I can currently tell, this means that a child is forked for every
> cachable request that comes in.

By my reading, should_proxy_garbage_coll is called before forking... and
the test you're suggesting is done in there -- although you did it a
different way, so maybe it's just the logic in should_proxy_garbage_coll
which is broken. 

There is definately some bug with the 1.3.7 proxy -- graham eliminated
his hanging troubles with 1.3.7-dev by using the 1.3.6 proxy code instead.

Dean

> This patch checks the mtime on the <cachedir>/.time file beforehand, and
> falls to the existing code if it hasn't been modified in the gcinterval.  I
> don't consider the code to be particularily optimal, as I don't quite
> understand the goals of some of the time checks in
> help_proxy_garbage_coll(), but trading a stat(2) for a fork(2) should always
> be a win (unless you're caching on an NFS partition, perhaps).  This only
> applies to Unix (on Win32, it goes directly to the check, without the fork,
> so no problem).
> 
> Due to Outlook mangling, I'm putting this patch at
> http://www.doubleu.com/Apache/cacheGC.patch.  Last night's graceful shutdown
> patch is at http://www.doubleu.com/Apache/graceful.patch.
> 
> Thanks,
> scott
> 
> 
> 


Mime
View raw message