httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Hess" <>
Subject cache GC check after fork patch
Date Thu, 03 Jun 1999 18:27:42 GMT
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.

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  Last night's graceful shutdown
patch is at


View raw message