httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29852] New: - CacheGcInterval values to stop GC
Date Mon, 28 Jun 2004 21:03:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29852>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29852

CacheGcInterval values to stop GC  

           Summary: CacheGcInterval values to stop GC
           Product: Apache httpd-1.3
           Version: 1.3.29
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_proxy
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: ram_k_m@yahoo.com


The documentation for mod_proxy says that if CacheGcInterval is not set, no
garbage collection will be performed, and the cache will grow indefinitely. But,
it's behaviour doesn't seem to be as specified. The default CacheGcInterval of 1
hour is used if no value is specified.

Line #110 mod_proxy.h 
#define DEFAULT_CACHE_GCINTERVAL SEC_ONE_HR

Ofcourse, the above can be easily resolved by updating the documentation. Now,
to the issue I have. How do you stop apache mod_proxy GC (if necessary)? See the
related code below...

mod_proxy.c

static const char *
     set_cache_gcint(cmd_parms *parms, void *dummy, char *arg)
{
   ...
   if (sscanf(arg, "%lg", &val) != 1)
        return "CacheGcInterval value must be a float";

    psf->cache.gcinterval = (int)(val * (double)SEC_ONE_HR);
    ...
}

proxy_cache.c 

static int should_proxy_garbage_coll(request_rec *r)
{
   ...
   time_t every = conf->gcinterval;

   if (cachedir == NULL || every == -1)
        return 0;
   
   // do GC
   ...
}

In order to make *every* variable to a value of -1, we need to specify
CacheGcInterval to a value in the range -0.00055 to -0.00028. Very obscure values. 

My suggestion would be stop all apache mod_proxy GC if the user specifies any
negative value for CacheGcInterval. The code change involved would be minor as
shown below - 

proxy_cache.c 

static int should_proxy_garbage_coll(request_rec *r)
{
   if (cachedir == NULL || every < 0)
        return 0;
   // do GC
}

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message