[3.0] 460b1d1 Add a new paramter "nuke_limit" which controls how many objects we are willing to evict per storage allocation attempt.
Tollef Fog Heen
tfheen at varnish-cache.org
Wed Aug 24 09:24:03 CEST 2011
commit 460b1d14dccb113a6cd5fe45c191025879f7089d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Aug 22 08:17:14 2011 +0000
Add a new paramter "nuke_limit" which controls how many objects we
are willing to evict per storage allocation attempt.
Previously this was hardcoded at 50, make it 10 instead.
diff --git a/bin/varnishd/heritage.h b/bin/varnishd/heritage.h
index 084d5dc..6571e31 100644
--- a/bin/varnishd/heritage.h
+++ b/bin/varnishd/heritage.h
@@ -117,6 +117,7 @@ struct params {
/* Fetcher hints */
unsigned fetch_chunksize;
unsigned fetch_maxchunksize;
+ unsigned nuke_limit;
#ifdef SENDFILE_WORKS
/* Sendfile object minimum size */
diff --git a/bin/varnishd/mgt_param.c b/bin/varnishd/mgt_param.c
index 7bfa707..45468c3 100644
--- a/bin/varnishd/mgt_param.c
+++ b/bin/varnishd/mgt_param.c
@@ -617,6 +617,12 @@ static const struct parspec input_parspec[] = {
"Restart child process automatically if it dies.\n",
0,
"on", "bool" },
+ { "nuke_limit",
+ tweak_uint, &master.nuke_limit, 0, UINT_MAX,
+ "Maximum number of objects we attempt to nuke in order"
+ "to make space for a object body.",
+ EXPERIMENTAL,
+ "10", "allocations" },
{ "fetch_chunksize",
tweak_uint, &master.fetch_chunksize, 4, UINT_MAX / 1024.,
"The default chunksize used by fetcher. "
@@ -1161,7 +1167,8 @@ MCF_DumpRst(void)
printf("%s\n", pp->name);
if (pp->units != NULL && *pp->units != '\0')
printf("\t- Units: %s\n", pp->units);
- printf("\t- Default: %s\n", strcmp(pp->def,MAGIC_INIT_STRING) == 0 ? "magic" : pp->def);
+ printf("\t- Default: %s\n",
+ strcmp(pp->def,MAGIC_INIT_STRING) == 0 ? "magic" : pp->def);
/*
* XXX: we should mark the params with one/two flags
* XXX: that say if ->min/->max are valid, so we
@@ -1198,7 +1205,10 @@ MCF_DumpRst(void)
} else if (*p == '\n') {
printf("\n\t");
} else if (*p == ':' && p[1] == '\n') {
- /* Start of definition list, use RSTs code mode for this */
+ /*
+ * Start of definition list,
+ * use RSTs code mode for this
+ */
printf("::\n");
} else {
printf("%c", *p);
More information about the varnish-commit
mailing list