r4715 - trunk/varnish-cache/bin/varnishd
phk at varnish-cache.org
phk at varnish-cache.org
Thu Apr 22 11:54:14 CEST 2010
Author: phk
Date: 2010-04-22 11:54:14 +0200 (Thu, 22 Apr 2010)
New Revision: 4715
Modified:
trunk/varnish-cache/bin/varnishd/hash_critbit.c
trunk/varnish-cache/bin/varnishd/heritage.h
trunk/varnish-cache/bin/varnishd/mgt_param.c
Log:
Make the critbit cooling off period a parameter.
Modified: trunk/varnish-cache/bin/varnishd/hash_critbit.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_critbit.c 2010-04-21 13:44:48 UTC (rev 4714)
+++ trunk/varnish-cache/bin/varnishd/hash_critbit.c 2010-04-22 09:54:14 UTC (rev 4715)
@@ -340,8 +340,6 @@
/**********************************************************************/
-#define COOL_DURATION 60 /* seconds */
-
static void *
hcb_cleaner(void *priv)
{
@@ -363,7 +361,7 @@
y = (void *)&oh->u;
if (y->leaf[0] || y->leaf[1])
continue;
- if (++oh->digest[0] > COOL_DURATION) {
+ if (++oh->digest[0] > params->critbit_cooloff) {
VTAILQ_REMOVE(&laylow, oh, coollist);
#ifdef PHK
fprintf(stderr, "OH %p is cold enough\n", oh);
Modified: trunk/varnish-cache/bin/varnishd/heritage.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/heritage.h 2010-04-21 13:44:48 UTC (rev 4714)
+++ trunk/varnish-cache/bin/varnishd/heritage.h 2010-04-22 09:54:14 UTC (rev 4715)
@@ -199,6 +199,8 @@
unsigned syslog_cli_traffic;
unsigned http_range_support;
+
+ double critbit_cooloff;
};
/*
Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-04-21 13:44:48 UTC (rev 4714)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-04-22 09:54:14 UTC (rev 4715)
@@ -817,6 +817,13 @@
"Enable support for HTTP Range headers.\n",
EXPERIMENTAL,
"off", "bool" },
+ { "critbit_cooloff", tweak_timeout_double,
+ &master.critbit_cooloff, 60, UINT_MAX,
+ "How long time the critbit hasher keeps deleted objheads "
+ "on the cooloff list.\n"
+ "A value of zero disables the ban lurker.",
+ EXPERIMENTAL,
+ "180.0", "s" },
{ NULL, NULL, NULL }
};
More information about the varnish-commit
mailing list