[master] 3602936 Remove the backend connection memory structure cache, it predates our import of JEmalloc, has been turned of by default and does not improve performance when turned on.
Poul-Henning Kamp
phk at varnish-cache.org
Thu Feb 17 21:52:35 CET 2011
commit 36029366a7b234e227208740d7903fc87c216490
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Feb 17 20:51:34 2011 +0000
Remove the backend connection memory structure cache, it predates
our import of JEmalloc, has been turned of by default and does
not improve performance when turned on.
diff --git a/bin/varnishd/cache_backend.c b/bin/varnishd/cache_backend.c
index 9330ec9..a1886e1 100644
--- a/bin/varnishd/cache_backend.c
+++ b/bin/varnishd/cache_backend.c
@@ -62,12 +62,6 @@ struct vdi_simple {
const struct vrt_backend *vrt;
};
-
-/*
- * List of cached vbcs, used if enabled in params/heritage
- */
-static VTAILQ_HEAD(,vbc) vbcs = VTAILQ_HEAD_INITIALIZER(vbcs);
-
/*--------------------------------------------------------------------
* Create default Host: header for backend request
*/
@@ -97,17 +91,10 @@ VBE_ReleaseConn(struct vbc *vc)
vc->addr = NULL;
vc->addrlen = 0;
vc->recycled = 0;
- if (params->cache_vbcs) {
- Lck_Lock(&VBE_mtx);
- VTAILQ_INSERT_HEAD(&vbcs, vc, list);
- VSC_main->backend_unused++;
- Lck_Unlock(&VBE_mtx);
- } else {
- Lck_Lock(&VBE_mtx);
- VSC_main->n_vbc--;
- Lck_Unlock(&VBE_mtx);
- free(vc);
- }
+ Lck_Lock(&VBE_mtx);
+ VSC_main->n_vbc--;
+ Lck_Unlock(&VBE_mtx);
+ FREE_OBJ(vc);
}
#define FIND_TMO(tmx, dst, sp, be) \
@@ -238,21 +225,8 @@ vbe_NewConn(void)
{
struct vbc *vc;
- vc = VTAILQ_FIRST(&vbcs);
- if (vc != NULL) {
- Lck_Lock(&VBE_mtx);
- vc = VTAILQ_FIRST(&vbcs);
- if (vc != NULL) {
- VSC_main->backend_unused--;
- VTAILQ_REMOVE(&vbcs, vc, list);
- }
- Lck_Unlock(&VBE_mtx);
- }
- if (vc != NULL)
- return (vc);
- vc = calloc(sizeof *vc, 1);
+ ALLOC_OBJ(vc, VBC_MAGIC);
XXXAN(vc);
- vc->magic = VBC_MAGIC;
vc->fd = -1;
Lck_Lock(&VBE_mtx);
VSC_main->n_vbc++;
diff --git a/bin/varnishd/heritage.h b/bin/varnishd/heritage.h
index d028b5a..7a8b90b 100644
--- a/bin/varnishd/heritage.h
+++ b/bin/varnishd/heritage.h
@@ -144,9 +144,6 @@ struct params {
/* Rush exponent */
unsigned rush_exponent;
- /* Cache vbcs */
- unsigned cache_vbcs;
-
/* Default connection_timeout */
double connect_timeout;
diff --git a/bin/varnishd/mgt_param.c b/bin/varnishd/mgt_param.c
index 7eb3234..aa0e693 100644
--- a/bin/varnishd/mgt_param.c
+++ b/bin/varnishd/mgt_param.c
@@ -656,10 +656,6 @@ static const struct parspec input_parspec[] = {
"Maximum depth of esi:include processing.\n",
0,
"5", "levels" },
- { "cache_vbcs", tweak_bool, &master.cache_vbcs, 0, 0,
- "Cache vbc's or rely on malloc, that's the question.",
- EXPERIMENTAL,
- "off", "bool" },
{ "connect_timeout", tweak_timeout_double,
&master.connect_timeout,0, UINT_MAX,
"Default connection timeout for backend connections. "
More information about the varnish-commit
mailing list