[master] 273513695 param: Increase the thread_pool_stack defaults

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 19 17:09:05 UTC 2021


commit 273513695fc212630cd6e4e7e5dde3f4ef77c839
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Aug 19 17:09:25 2021 +0200

    param: Increase the thread_pool_stack defaults
    
    And use the 64bit default as a dynamic default to have it show up in the
    varnishd manual. Since we explicitly document the 32bit default in the
    same manual it shouldn't be controversial.
    
    The reason to increase them is the PCRE2 jit compiler that produces
    stack-hungry code.
    
    Refs #3671

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 34e23d466..cdeaa3d18 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -666,7 +666,7 @@ MCF_InitParams(struct cli *cli)
 
 	MCF_TcpParams();
 
-	def = 56 * 1024;
+	def = 80 * 1024;
 
 	if (sizeof(void *) < 8) {		/*lint !e506 !e774  */
 		/*
@@ -682,14 +682,14 @@ MCF_InitParams(struct cli *cli)
 		MCF_ParamConf(MCF_DEFAULT, "gzip_buffer", "4k");
 		MCF_ParamConf(MCF_DEFAULT, "vsl_buffer", "4k");
 		MCF_ParamConf(MCF_MAXIMUM, "vsl_space", "1G");
-		def = 52 * 1024;
+		def = 64 * 1024;
 	}
 
 	low = sysconf(_SC_THREAD_STACK_MIN);
 	MCF_ParamConf(MCF_MINIMUM, "thread_pool_stack", "%jdb", (intmax_t)low);
 
 #if defined(__SANITIZER) || __has_feature(address_sanitizer) || defined(GCOVING)
-	def = 92 * 1024;
+	def = 192 * 1024;
 #endif
 
 	if (def < low)
diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst
index e87f48a14..301b8bd66 100644
--- a/doc/sphinx/reference/varnishd.rst
+++ b/doc/sphinx/reference/varnishd.rst
@@ -528,7 +528,7 @@ space:
 * gzip_buffer: 4k
 * vsl_buffer: 4k
 * vsl_space: 1G (maximum)
-* thread_pool_stack: 52k
+* thread_pool_stack: 64k
 
 .. _List of Parameters:
 
diff --git a/include/tbl/params.h b/include/tbl/params.h
index edae76b28..26345d6c3 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1538,7 +1538,7 @@ PARAM_THREAD(
 	/* flags */	DELAYED_EFFECT,
 	/* dyn_min_reason */	"sysconf(_SC_THREAD_STACK_MIN)",
 	/* dyn_max_reason */	NULL,
-	/* dyn_def_reason */	NULL
+	/* dyn_def_reason */	"80k"
 )
 
 #if defined(PARAM_ALL)


More information about the varnish-commit mailing list