[master] 345548166 Use the dynamic param bounds in the manual

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Oct 29 15:21:06 UTC 2019


commit 3455481663565dc43cbff92b47a15492515075ef
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Oct 29 16:12:43 2019 +0100

    Use the dynamic param bounds in the manual
    
    Instead of having to manually document them, we can now let the RST dump
    figure everything out.
    
    Refs #3099

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index b15540f32..67bacd946 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -751,9 +751,13 @@ MCF_DumpRstParam(void)
 		if (pp->units != NULL && *pp->units != '\0')
 			printf("\t* Units: %s\n", pp->units);
 		printf("\t* Default: %s\n", pp->def);
-		if (pp->min != NULL)
+		if (pp->dyn_min_reason != NULL)
+			printf("\t* Minimum: %s\n", pp->dyn_min_reason);
+		else if (pp->min != NULL)
 			printf("\t* Minimum: %s\n", pp->min);
-		if (pp->max != NULL)
+		if (pp->dyn_max_reason != NULL)
+			printf("\t* Maximum: %s\n", pp->dyn_max_reason);
+		else if (pp->max != NULL)
 			printf("\t* Maximum: %s\n", pp->max);
 		/*
 		 * XXX: we should mark the params with one/two flags
diff --git a/bin/varnishd/mgt/mgt_pool.c b/bin/varnishd/mgt/mgt_pool.c
index 8367453b6..b32224d72 100644
--- a/bin/varnishd/mgt/mgt_pool.c
+++ b/bin/varnishd/mgt/mgt_pool.c
@@ -106,8 +106,7 @@ struct parspec WRK_parspec[] = {
 		"2", "pools" },
 	{ "thread_pool_max", tweak_thread_pool_max, &mgt_param.wthread_max,
 		NULL, NULL,
-		"The maximum number of worker threads in each pool. The "
-		"minimum value depends on thread_pool_min.\n"
+		"The maximum number of worker threads in each pool.\n"
 		"\n"
 		"Do not set this higher than you have to, since excess "
 		"worker threads soak up RAM and CPU and generally just get "
@@ -117,8 +116,7 @@ struct parspec WRK_parspec[] = {
 		"thread_pool_min" },
 	{ "thread_pool_min", tweak_thread_pool_min, &mgt_param.wthread_min,
 		NULL, NULL,
-		"The minimum number of worker threads in each pool. The "
-		"maximum value depends on thread_pool_max.\n"
+		"The minimum number of worker threads in each pool.\n"
 		"\n"
 		"Increasing this may help ramp up faster from low load "
 		"situations or when threads have expired.\n"
@@ -144,7 +142,7 @@ struct parspec WRK_parspec[] = {
 		"unused.\n"
 		"\n"
 		"Default is 0 to auto-tune (currently 5% of thread_pool_min).\n"
-		"Minimum is 1 otherwise, maximum is 95% of thread_pool_min.",
+		"Minimum is 1 otherwise.",
 		DELAYED_EFFECT,
 		"0", "threads",
 		NULL, "95% of thread_pool_min" },


More information about the varnish-commit mailing list