[master] ec38fd3 Remove the busyobj_worker_cache parameter, which has defaulted to "off" for a very long time and never been shown to actually improve performance.

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


commit ec38fd337091cd5b989f02633dc0596cb2799cee
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat May 30 20:57:26 2015 +0000

    Remove the busyobj_worker_cache parameter, which has defaulted to "off"
    for a very long time and never been shown to actually improve performance.
    
    These days we pick busyobj out of a memory pool which gives us much better
    control of the amount of memory sitting idle waiting to become a busyobj.
    
    In case a single mempool not scale well enough, we make a mempool per
    thread pool to scale horizontally.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index f1cd990..a2d1441 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -328,7 +328,6 @@ struct worker {
 	struct objhead		*nobjhead;
 	struct objcore		*nobjcore;
 	struct waitinglist	*nwaitinglist;
-	struct busyobj		*nbo;
 	void			*nhashpriv;
 	struct dstat		stats[1];
 	struct vsl_log		*vsl;		// borrowed from req/bo
diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index 2ba43fd..2ac9006 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -92,21 +92,14 @@ VBO_Free(struct busyobj **bop)
 struct busyobj *
 VBO_GetBusyObj(struct worker *wrk, const struct req *req)
 {
-	struct busyobj *bo = NULL;
+	struct busyobj *bo;
 	uint16_t nhttp;
 	unsigned sz;
 	char *p;
 
 	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 
-	if (wrk->nbo != NULL) {
-		bo = wrk->nbo;
-		wrk->nbo = NULL;
-	}
-
-	if (bo == NULL)
-		bo = vbo_New();
-
+	bo = vbo_New();
 	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
 	AZ(bo->refcount);
 
@@ -222,10 +215,7 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
 	memset(&bo->refcount, 0,
 	    sizeof *bo - offsetof(struct busyobj, refcount));
 
-	if (cache_param->bo_cache && wrk != NULL && wrk->nbo == NULL)
-		wrk->nbo = bo;
-	else
-		VBO_Free(&bo);
+	VBO_Free(&bo);
 }
 
 void
diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index e95b1eb..ee8bd5e 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -125,8 +125,6 @@ WRK_Thread(struct pool *qp, size_t stacksize, unsigned thread_workspace)
 	if (w->vcl != NULL)
 		VCL_Rel(&w->vcl);
 	AZ(pthread_cond_destroy(&w->cond));
-	if (w->nbo != NULL)
-		VBO_Free(&w->nbo);
 	HSH_Cleanup(w);
 	Pool_Sumstat(w);
 }
diff --git a/bin/varnishd/common/params.h b/bin/varnishd/common/params.h
index d623447..c8cd3a6 100644
--- a/bin/varnishd/common/params.h
+++ b/bin/varnishd/common/params.h
@@ -194,8 +194,6 @@ struct params {
 
 	struct vre_limits	vre_limits;
 
-	unsigned		bo_cache;
-
 	/* Install a SIGSEGV handler */
 	unsigned		sigsegv_handler;
 
diff --git a/bin/varnishd/mgt/mgt_param_tbl.c b/bin/varnishd/mgt/mgt_param_tbl.c
index f72714a..60a0c4e 100644
--- a/bin/varnishd/mgt/mgt_param_tbl.c
+++ b/bin/varnishd/mgt/mgt_param_tbl.c
@@ -506,15 +506,6 @@ struct parspec mgt_parspec[] = {
 		MUST_RESTART,
 		"1M", "bytes"},
 
-	{ "busyobj_worker_cache", tweak_bool,
-		&mgt_param.bo_cache,
-		NULL, NULL,
-		"Cache free busyobj per worker thread. "
-		"Disable this if you have very high hitrates and want "
-		"to save the memory of one busyobj per worker thread.",
-		0,
-		"off", "bool"},
-
 	{ "pool_req", tweak_poolparam, &mgt_param.req_pool,
 		NULL, NULL,
 		"Parameters for per worker pool request memory pool.\n"
diff --git a/include/tbl/params.h b/include/tbl/params.h
index 49fc7d0..1581374 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -198,43 +198,6 @@ PARAM(
 /**********************************************************************/
 #if 0 /* NOT YET */
 
-#if 0
-PARAM(
-	/* name */	busyobj_worker_cache,
-	/* tweak */	tweak_bool,
-	/* var */	busyobj_worker_cache,
-	/* min */	none,
-	/* max */	none,
-	/* default */	off,
-	/* units */	bool,
-	/* flags */	00,
-	/* s-text */
-	"Cache free busyobj per worker thread. Disable this if you have "
-	"very high hitrates and want to save the memory of one busyobj per "
-	"worker thread.\n",
-	/* l-text */	"",
-	/* func */	NULL
-)
-#endif
-#if 0
-PARAM(
-	/* name */	cc_command,
-	/* tweak */	tweak_string,
-	/* var */	cc_command,
-	/* min */	none,
-	/* max */	none,
-	/* default */	"exec clang -std=gnu99 -g -O2 -Wall -Werror -Wno-error=unused-result  \t-Werror \t-Wall \t-Wno-format-y2k \t-W \t-Wstrict-prototypes \t-Wmissing-prototypes \t-Wpointer-arith \t-Wreturn-type \t-Wcast-qual \t-Wwrite-strings \t-Wswitch \t-Wshadow \t-Wunused-parameter \t-Wcast-align \t-Wchar-subscripts \t-Wnested-externs \t-Wextra \t-Wno-sign-compare  -fstack-protector -Wno-pointer-sign -Wno-address -Wno-missing-field-initializers -D_THREAD_SAFE -pthread -fpic -shared -Wl,-x -o %o %s",
-	/* units */	(null),
-	/* flags */	0| MUST_RELOAD,
-	/* s-text */
-	"Command used for compiling the C source code to a dlopen(3) "
-	"loadable object.  Any occurrence of %s in the string will be "
-	"replaced with the source file name, and %o will be replaced with "
-	"the output file name.\n",
-	/* l-text */	"",
-	/* func */	NULL
-)
-#endif
 PARAM(
 	/* name */	cli_buffer,
 	/* tweak */	tweak_bytes_u,



More information about the varnish-commit mailing list