[master] 519fca1 Move more parameters over to the new table format.

Poul-Henning Kamp phk at FreeBSD.org
Sat May 30 22:47:44 CEST 2015


commit 519fca16c92dbef6c4e6bff99097fad3d506e666
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat May 30 20:47:22 2015 +0000

    Move more parameters over to the new table format.

diff --git a/bin/varnishd/common/params.h b/bin/varnishd/common/params.h
index a20fe47..d623447 100644
--- a/bin/varnishd/common/params.h
+++ b/bin/varnishd/common/params.h
@@ -60,12 +60,14 @@ struct params {
 #define	ptyp_bool	unsigned
 #define	ptyp_double	double
 #define	ptyp_timeout	double
+#define	ptyp_uint	unsigned
 #define PARAM(nm, ty, mi, ma, de, un, fl, st, lt, fn) ptyp_##ty nm;
 #include <tbl/params.h>
 #undef PARAM
 #undef ptyp_bool
 #undef ptyp_double
 #undef ptyp_timeout
+#undef ptyp_uint
 
 	/* Unprivileged user / group */
 	char			*user;
@@ -130,9 +132,6 @@ struct params {
 	double			tcp_keepalive_intvl;
 #endif
 
-	/* Management hints */
-	unsigned		auto_restart;
-
 	/* Fetcher hints */
 	ssize_t			fetch_chunksize;
 	ssize_t			fetch_maxchunksize;
@@ -166,7 +165,6 @@ struct params {
 
 	/* Read timeouts for backend */
 	double			first_byte_timeout;
-	double			between_bytes_timeout;
 
 	/* CLI buffer size */
 	unsigned		cli_buffer;
@@ -177,13 +175,6 @@ struct params {
 	/* Acceptable clockskew with backends */
 	unsigned		clock_skew;
 
-	/* Get rid of duplicate bans */
-	unsigned		ban_dups;
-
-	double			ban_lurker_age;
-	double			ban_lurker_sleep;
-	unsigned		ban_lurker_batch;
-
 	unsigned		syslog_cli_traffic;
 
 	unsigned		http_range_support;
diff --git a/bin/varnishd/mgt/mgt_param_tbl.c b/bin/varnishd/mgt/mgt_param_tbl.c
index c97d3ff..f72714a 100644
--- a/bin/varnishd/mgt/mgt_param_tbl.c
+++ b/bin/varnishd/mgt/mgt_param_tbl.c
@@ -205,11 +205,6 @@ struct parspec mgt_parspec[] = {
 		"See setsockopt(2) under SO_SNDTIMEO for more information.",
 		DELAYED_EFFECT,
 		"60", "seconds" },
-	{ "auto_restart", tweak_bool, &mgt_param.auto_restart,
-		NULL, NULL,
-		"Restart child process automatically if it dies.",
-		0,
-		"on", "bool" },
 	{ "nuke_limit",
 		tweak_uint, &mgt_param.nuke_limit,
 		"0", NULL,
@@ -324,17 +319,6 @@ struct parspec mgt_parspec[] = {
 		"backend request. This parameter does not apply to pipe.",
 		0,
 		"60", "seconds" },
-	{ "between_bytes_timeout", tweak_timeout,
-		&mgt_param.between_bytes_timeout,
-		"0", NULL,
-		"Default timeout between bytes when receiving data from "
-		"backend. "
-		"We only wait for this many seconds between bytes "
-		"before giving up. A value of 0 means it will never time out. "
-		"VCL can override this default value for each backend request "
-		"and backend request. This parameter does not apply to pipe.",
-		0,
-		"60", "seconds" },
 	{ "clock_skew", tweak_uint, &mgt_param.clock_skew,
 		"0", NULL,
 		"How much clockskew we are willing to accept between the "
@@ -369,48 +353,11 @@ struct parspec mgt_parspec[] = {
 		"more sessions take a detour around the waiter.",
 		EXPERIMENTAL,
 		"0.050", "seconds" },
-	{ "ban_dups", tweak_bool, &mgt_param.ban_dups,
-		NULL, NULL,
-		"Eliminate older identical bans when new bans are created."
-		"  This test is CPU intensive and scales with the number and"
-		" complexity of active (non-Gone) bans.  If identical bans"
-		" are frequent, the amount of CPU needed to actually test "
-		" the bans will be similarly reduced.",
-		0,
-		"on", "bool" },
 	{ "syslog_cli_traffic", tweak_bool, &mgt_param.syslog_cli_traffic,
 		NULL, NULL,
 		"Log all CLI traffic to syslog(LOG_INFO).",
 		0,
 		"on", "bool" },
-	{ "ban_lurker_age", tweak_timeout,
-		&mgt_param.ban_lurker_age,
-		"0", NULL,
-		"The ban lurker does not process bans until they are this"
-		" old.  Right when a ban is added, the most frequently hit"
-		" objects will get tested against it as part of object"
-		" lookup.  This parameter prevents the ban-lurker from"
-		" kicking in, until the rush is over.",
-		0,
-		"60", "seconds" },
-	{ "ban_lurker_sleep", tweak_timeout,
-		&mgt_param.ban_lurker_sleep,
-		"0", NULL,
-		"The ban lurker thread sleeps between work batches, in order"
-		" to not monopolize CPU power."
-		"  When nothing is done, it sleeps a fraction of a second"
-		" before looking for new work to do.\n"
-		"A value of zero disables the ban lurker.",
-		0,
-		"0.01", "seconds" },
-	{ "ban_lurker_batch", tweak_uint,
-		&mgt_param.ban_lurker_batch,
-		"1", NULL,
-		"How many objects the ban lurker examines before taking a"
-		" ban_lurker_sleep.  Use this to pace the ban lurker so it"
-		" does not eat too much CPU.",
-		0,
-		"1000", "" },
 	{ "http_range_support", tweak_bool, &mgt_param.http_range_support,
 		NULL, NULL,
 		"Enable support for HTTP Range headers.",
diff --git a/include/tbl/params.h b/include/tbl/params.h
index 12afdaa..49fc7d0 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -97,108 +97,107 @@ PARAM(
 	/* func */	NULL
 )
 
-/**********************************************************************/
-#if 0 /* NOT YET */
 PARAM(
 	/* name */	auto_restart,
-	/* tweak */	tweak_bool,
-	/* var */	auto_restart,
-	/* min */	none,
-	/* max */	none,
-	/* default */	on,
-	/* units */	bool,
-	/* flags */	00,
+	/* typ */	bool,
+	/* min */	NULL,
+	/* max */	NULL,
+	/* default */	"on",
+	/* units */	"bool",
+	/* flags */	0,
 	/* s-text */
-	"Restart child process automatically if it dies.\n",
+	"Automatically restart the child/worker process if it dies.",
 	/* l-text */	"",
 	/* func */	NULL
 )
+
 PARAM(
 	/* name */	ban_dups,
-	/* tweak */	tweak_bool,
-	/* var */	ban_dups,
-	/* min */	none,
-	/* max */	none,
-	/* default */	on,
-	/* units */	bool,
-	/* flags */	00,
+	/* typ */	bool,
+	/* min */	NULL,
+	/* max */	NULL,
+	/* default */	"on",
+	/* units */	"bool",
+	/* flags */	0,
 	/* s-text */
-	"Eliminate older identical bans when new bans are created.  This "
-	"test is CPU intensive and scales with the number and complexity "
-	"of active (non-Gone) bans.  If identical bans are frequent, the "
-	"amount of CPU needed to actually test  the bans will be similarly "
-	"reduced.\n",
+	"Eliminate older identical bans when a new ban is added.  This saves "
+	"CPU cycles by not comparing objects to identical bans.\n"
+	"This is a waste of time if you have many bans which are never "
+	"identical.",
 	/* l-text */	"",
 	/* func */	NULL
 )
+
 PARAM(
 	/* name */	ban_lurker_age,
-	/* tweak */	tweak_timeout,
-	/* var */	ban_lurker_age,
-	/* min */	0.000,
-	/* max */	none,
-	/* default */	60.000,
-	/* units */	seconds,
-	/* flags */	00,
+	/* tweak */	timeout,
+	/* min */	"0",
+	/* max */	NULL,
+	/* default */	"60",
+	/* units */	"seconds",
+	/* flags */	0,
 	/* s-text */
-	"The ban lurker does not process bans until they are this old.  "
-	"Right when a ban is added, the most frequently hit objects will "
+	"The ban lurker only process bans when they are this old.  "
+	"When a ban is added, the most frequently hit objects will "
 	"get tested against it as part of object lookup.  This parameter "
-	"prevents the ban-lurker from kicking in, until the rush is over.\n",
+	"prevents the ban-lurker from kicking in, until the rush is over.",
 	/* l-text */	"",
 	/* func */	NULL
 )
+
 PARAM(
 	/* name */	ban_lurker_batch,
-	/* tweak */	tweak_uint,
-	/* var */	ban_lurker_batch,
-	/* min */	1,
-	/* max */	none,
-	/* default */	1000,
-	/* units */	,
-	/* flags */	00,
+	/* tweak */	uint,
+	/* min */	"1",
+	/* max */	NULL,
+	/* default */	"1000",
+	/* units */	NULL,
+	/* flags */	0,
 	/* s-text */
-	"How many objects the ban lurker examines before taking a "
-	"ban_lurker_sleep.  Use this to pace the ban lurker so it does not "
-	"eat too much CPU.\n",
+	"The ban lurker slees ${ban_lurker_sleep} after examining this "
+	"many objects.  Use this to pace the ban-lurker if it eats too "
+	"many resources.",
 	/* l-text */	"",
 	/* func */	NULL
 )
+
 PARAM(
 	/* name */	ban_lurker_sleep,
-	/* tweak */	tweak_timeout,
-	/* var */	ban_lurker_sleep,
-	/* min */	0.000,
-	/* max */	none,
-	/* default */	0.010,
-	/* units */	seconds,
-	/* flags */	00,
+	/* tweak */	timeout,
+	/* min */	"0",
+	/* max */	NULL,
+	/* default */	"0.010",
+	/* units */	"seconds",
+	/* flags */	0,
 	/* s-text */
-	"The ban lurker thread sleeps between work batches, in order to "
-	"not monopolize CPU power.  When nothing is done, it sleeps a "
-	"fraction of a second before looking for new work to do.\n"
-	"A value of zero disables the ban lurker.\n",
+	"How long the ban lurker sleeps after examining ${ban_lurker_batch} "
+	"objects.\n"
+	"A value of zero will disable the ban lurker entirely.",
 	/* l-text */	"",
 	/* func */	NULL
 )
+
 PARAM(
 	/* name */	between_bytes_timeout,
-	/* tweak */	tweak_timeout,
-	/* var */	between_bytes_timeout,
-	/* min */	0.000,
-	/* max */	none,
-	/* default */	60.000,
-	/* units */	seconds,
-	/* flags */	00,
+	/* tweak */	timeout,
+	/* min */	"0",
+	/* max */	NULL,
+	/* default */	"60",
+	/* units */	"seconds",
+	/* flags */	0,
 	/* s-text */
-	"Default timeout between bytes when receiving data from backend. "
-	"We only wait for this many seconds between bytes before giving "
-	"up. A value of 0 means it will never time out. VCL can override "
-	"this default value for each backend request and backend request. "
-	"This parameter does not apply to pipe.\n",
+	"We only wait for this many seconds between bytes received from "
+	"the backend before giving up the fetch.\n"
+	"A value of zero means never give up.\n"
+	"VCL values, per backend or per backend request take precedence.\n"
+	"This parameter does not apply to pipe'ed requests.",
 	/* l-text */	"",
 	/* func */	NULL
 )
+
+/**********************************************************************/
+#if 0 /* NOT YET */
+
 #if 0
 PARAM(
 	/* name */	busyobj_worker_cache,



More information about the varnish-commit mailing list