Commit d9ad3099 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the critbit cooling off period a parameter.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4715 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a4689094
......@@ -340,8 +340,6 @@ static struct cli_proto hcb_cmds[] = {
/**********************************************************************/
#define COOL_DURATION 60 /* seconds */
static void *
hcb_cleaner(void *priv)
{
......@@ -363,7 +361,7 @@ hcb_cleaner(void *priv)
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);
......
......@@ -199,6 +199,8 @@ struct params {
unsigned syslog_cli_traffic;
unsigned http_range_support;
double critbit_cooloff;
};
/*
......
......@@ -817,6 +817,13 @@ static const struct parspec input_parspec[] = {
"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 }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment